Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using outlook with a custom template

Status
Not open for further replies.

RoadRunnerOz

Programmer
Aug 22, 2000
128
AU
I need to send e-mail messages using Outlook 98 from VFP6. I need/want to send these e-mails using custom HTML forms which I have saved as templates. ( response1.oft, response2.oft etc...) I know how to automatically open these templates outside of Outlook ( via shellexecute) but I don't have a clue as to how I can ADD my text to the body.

Thanks in advance

Michael Ouellette
mouellette@compuserve.com
 
Have a look into
How can I send an Email using OUTLOOK from VFP?
FAQ184-766
May be it helps you :)

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Thanks.. I understand the model. The problem is adding text, To, CC, subject etc to a variable custom template.

IE How do I point to a specific template in the outlook object?

Thanks Michael Ouellette
mouellette@compuserve.com
 
Hi
You have saved as templates. ( response1.oft, response2.oft etc...). You know how to automatically open these templates outside of Outlook ( via shellexecute).

Now having collected the information...

o=createobject("outlook.application")
oitem=o.createitem(0)
DO WHILE .t. or if the data saved in to a DBF .. SCAN..ENDSCAN loop can be used....
oitem.subject=MySubject
oitem.to=MyemailAddress
oitem.body=MyBody
oitem.attachments = "FullPath"+"FileName"
oitem.send
** loop to next item by loading your data again
** if last item.. exit
ENDDO or endscan

o=.null.

Hope this helps.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Thanks again but
I've already done all of this many times in the past:

SCAN
oitem.subject=MySubject...
etc ...
oitem.save

oitem.send()
endscan

So how do I get MySubject, MyBody etc into response1.oft ???

This opens the response1 template:

Declare INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
* =ShellExecute(0,lcOperation,lcFileName,"",lcWorkDir,1)
=ShellExecute(0,"Open","response1.oft","",sys(5)+sys(2003)+"\",1)

Is it the cparameters section????

Thanks






Michael Ouellette
mouellette@compuserve.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top