Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alternating Email Clients
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Alternating Email Clients
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
00976862
Message ID:
00976862
Vues:
40
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 
Répondre
Fil
Voir

Click here to load this message in the networking platform