Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternating Email Clients
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Alternating Email Clients
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
00976862
Message ID:
00976862
Views:
41
Why would the following code on the 1st call launch Outlook Express which is the default mail client on each machine, then on subsequent calls launch Outlook?

note: All variables are local and go out of scope after each call.
TRY 
	loMapiSession = CREATEOBJECT('MSMAPI.MapiSession')
	IF VARTYPE(loMapiSession)='O'
		WITH loMapiSession
			.UserName=""
			.Password=""
			.SigNon()
			IF (.SessionID>0)
				loMapiMessage=CREATEOBJECT('MSMAPI.MapiMessages')
				IF VARTYPE(loMapiMessage)='O'
					loMapiMessage.SessionID=.SessionId
					WITH loMapiMessage
						.Compose()
						.MsgSubject=tcSubject
						.MsgNoteText=tcBody
						lnAttachCnt=0
						FOR i = 1 TO GETWORDCOUNT(tcAttachments,';')
							lcFileName=GETWORDNUM(tcAttachments,i,';')
							IF !EMPTY(lcFileName) AND FILE(lcFileName)
								.AttachmentIndex=lnAttachCnt
								.AttachmentPosition=lnAttachCnt
								.AttachmentName=JUSTFNAME(lcFileName)
								.AttachmentPathName=FULLPATH(lcFileName)
								.AttachmentType=0
								lnAttachCnt=lnAttachCnt+1
							ENDIF 
						ENDFOR 
						.Send(.T.)
					ENDWITH 
				ENDIF 
			ENDIF 
		ENDWITH 	
	ENDIF 
CATCH TO loErr
	IF ![user cancelled]$LOWER(loErr.message)
		=MESSAGEBOX(loErr.Message,16,'Error Sending MAPI Mail')
	ENDIF 
FINALLY
	CD (lcCurDir)
ENDTRY 
Reply
Map
View

Click here to load this message in the networking platform