Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Email attachment not current data
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Email attachment not current data
Divers
Thread ID:
00911281
Message ID:
00911281
Vues:
49
I am mergeing data to a word document. This is the code which works fine until I try to email it.
oMemoDoc.MailMerge.Execute()

* reference the merged document prior to printing
oMergedDocument = oword.ActiveDocument

IF nOut = 1  && going to the printer
	* print merged result
	oMergedDocument.PrintOut(.T.)
ELSE	&& going to outlook
	* get Mailto address and Subject and any Body text
	do form frmMailTo to lcMailToData with ThisForm.p_Bldg_Number
assert !empty(lcMailToData) message "TEST stop to look at email properties"
	if !empty(lcMailToData)
		* send the email
		lcMsg = ThisForm.m_Send_Email(lcMailToData,oMergedDocument)
	else
		lcMsg = "Send Email was CANCELED"
	endif
ENDIF
return lcMsg
Since "oMergedDocument" is an object reference and not the complete path and file name, "oMail.attachments.add(oMergedDocument)" fails. Do I need to save the document after mail merge? If so, how(command)? Does it need to be deleted after process succeeds? if so, what is the command? I am having trouble finding these reference in the Office Automation book.

Thanks, Chuck
Extreme Programming = Plan -> Design -> Code -> Test
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform