Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NBC MAPI Mail class - Read attachment
Message
 
 
To
27/05/2008 01:18:50
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01319594
Message ID:
01319619
Views:
18
Unlike the rest of the methods you're using, the GetAttachmentFile() doesn't have Message # parameter and works of the curent message. I would recoment to select current message with Getmessage and process it w/o refering to the message # .
WITH THISFORM.Cusmapi1
	mNumberOfMail = .ReadMail()
	IF mNumberOfMail > 0
		FOR mMailCnt = 1 TO mNumberOfMail
			* Select current message
			.Getmessage(mMailCnt)
			mSender  = 'Sender     : ' + .GetSender()
			mSubject = 'Subject    : ' + .GetSubject()
			mBody    = .GetBodyText()
			mCount   = .GetAttachmentCount()
			IF mCount > 0
				FOR mAttachFileCnt = 1 TO mCount
					mAttachFile   = .GetAttachmentFile(mAttachFileCnt)
					MESSAGEBOX(mAttachFile)  &&Show Only 1st Email's Attachment
				ENDFOR
			ENDIF
		ENDFOR
	ENDIF
ENDWITH
>I m using NBC MAIP Mail Class to read attachment.
>
>But It only allow read 1st email's attachment.
>
>What wrong with my code? Thanks
>
>
>
>mNumberOfMail =THISFORM.Cusmapi1.ReadMail()
>IF mNumberOfMail > 0
>  FOR mMailCnt = 1 TO mNumberOfMail
>
>    mSender  = 'Sender     : '+THISFORM.CusMapi1.GetSender(mMailCnt)
>    mSubject = 'Subject    : '+THISFORM.CusMapi1.GetSubject(mMailCnt)
>    mBody    = THISFORM.CusMapi1.GetBodyText(mMailCnt)
>    mCount   = THISFORM.CusMapi1.GetAttachmentCount(mMailCnt)
>    IF mCount > 0
>      FOR mAttachFileCnt = 1 TO mCount
>        mAttachFile   = THISFORM.CusMapi1.GetAttachmentFile(mAttachFileCnt)
>        MESSAGEBOX(mAttachFile)  &&Show Only 1st Email's Attachment
>      ENDFOR
>    ENDIF	
>  ENDFOR
>ENDIF
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform