S slayer New Member Jan 28, 2003 #1 Does anyone have a sample code how can I fill in the selected result set by SQL or 4GL into the message body in Outlook?
Does anyone have a sample code how can I fill in the selected result set by SQL or 4GL into the message body in Outlook?
F Fredmeu New Member Mar 28, 2003 #2 slayer said: Does anyone have a sample code how can I fill in the selected result set by SQL or 4GL into the message body in Outlook? Click to expand... I've included a very straightforward solution below; DEFINE VARIABLE myOlApp AS COM-HANDLE. DEFINE VARIABLE Myitem AS COM-HANDLE. DEFINE VARIABLE myRecipient AS COM-HANDLE. DEFINE VARIABLE myAttachments AS COM-HANDLE. CREATE "Outlook.Application" myOlApp. ASSIGN Myitem = myOlApp:CreateItem(0). Myitem:HTMLBody = "<html><body>". /*ASSIGN recipients*/ ASSIGN myRecipient = Myitem:Recipients:Add("Recipient1"). myRecipient:Type = 1. /*ASSIGN Cc recipients*/ ASSIGN myRecipient = Myitem:Recipients:Add("CCRecipient"). myRecipient:Type = 2. /*ASSIGN Onderwerp*/ Myitem:Subject = "Subject". /*ASSIGN mailtext*/ Myitem:HTMLBody = Myitem:HTMLBody + "This is the message body:". /*ASSIGN attachments*/ ASSIGN myAttachments = Myitem:Attachments. /*full attachment added */ myAttachments:Add ("C:\graph.pps", 1, , "Graph with results 4th quarter 1996"). /*Or hyperlink url to attachment*/ Myitem:HTMLBody = Myitem:HTMLBody + '<A HREF="http://test123.com/graph.pps">Graph with results 4th quarter 1996</A>'. /*Show new mail*/ Myitem:HTMLBody = Myitem:HTMLBody + "</body></html>". Myitemisplay. myOlApp:Quit(). release object myOlApp. Hope this helps.... Fred van der Meulen Vitalogic BV Netherlands..
slayer said: Does anyone have a sample code how can I fill in the selected result set by SQL or 4GL into the message body in Outlook? Click to expand... I've included a very straightforward solution below; DEFINE VARIABLE myOlApp AS COM-HANDLE. DEFINE VARIABLE Myitem AS COM-HANDLE. DEFINE VARIABLE myRecipient AS COM-HANDLE. DEFINE VARIABLE myAttachments AS COM-HANDLE. CREATE "Outlook.Application" myOlApp. ASSIGN Myitem = myOlApp:CreateItem(0). Myitem:HTMLBody = "<html><body>". /*ASSIGN recipients*/ ASSIGN myRecipient = Myitem:Recipients:Add("Recipient1"). myRecipient:Type = 1. /*ASSIGN Cc recipients*/ ASSIGN myRecipient = Myitem:Recipients:Add("CCRecipient"). myRecipient:Type = 2. /*ASSIGN Onderwerp*/ Myitem:Subject = "Subject". /*ASSIGN mailtext*/ Myitem:HTMLBody = Myitem:HTMLBody + "This is the message body:". /*ASSIGN attachments*/ ASSIGN myAttachments = Myitem:Attachments. /*full attachment added */ myAttachments:Add ("C:\graph.pps", 1, , "Graph with results 4th quarter 1996"). /*Or hyperlink url to attachment*/ Myitem:HTMLBody = Myitem:HTMLBody + '<A HREF="http://test123.com/graph.pps">Graph with results 4th quarter 1996</A>'. /*Show new mail*/ Myitem:HTMLBody = Myitem:HTMLBody + "</body></html>". Myitemisplay. myOlApp:Quit(). release object myOlApp. Hope this helps.... Fred van der Meulen Vitalogic BV Netherlands..