|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
save email in Outlook Automation
I m working on MS Outlook automation...
my problem is.... when i tried to save my email using "myMail.saveAs" property then it does not save the body of email... i printed the email body just befor sending it using debug.print myMail.HTMLBody.. and it displays it but does not show me neither in sent folder nor in saved email but the recieved email shows the body correctly i m using Outlook 2002 with VB 6 plz help me out ... many thanx in advance Murtaza code is written below: ------------------------------------------------------------ Dim myMail As MailItem Dim myRecipient As Recipient Dim myAttachments As Attachments Set myMail = outApp.CreateItem(olMailItem) Set myAttachments = myMail.Attachments myAttachments.Add "C:\MyWord.doc" Set myRecipient = myMail.Recipients.Add("mxtaza@test.com") myMail.SentOnBehalfOfName = "test@test.com" myMail.Subject = param_subject myMail.HTMLBody = param_body Debug.Print myMail.HTMLBody myMail.SaveAs App.Path & "\SentEmail.msg" myMail.Send Set myAttachments = Nothing Set myRecipient = Nothing Set myMail = Nothing |
|
#2
|
|||
|
|||
|
solution to save email in Outlook Automation
hey man i ve got my answer...
just use this line before sending the email myMail.BodyFormat = olFormatRichText and the rest is working fine ... many many thanx for all of those who have helped me in this regard. Murtaza code is written below: ------------------------------------------------------------ Dim myMail As MailItem Dim myRecipient As Recipient Dim myAttachments As Attachments Set myMail = outApp.CreateItem(olMailItem) Set myAttachments = myMail.Attachments myAttachments.Add "C:\MyWord.doc" Set myRecipient = myMail.Recipients.Add("mxtaza@test.com") myMail.SentOnBehalfOfName = "test@test.com" myMail.BodyFormat = olFormatRichText myMail.Subject = param_subject myMail.HTMLBody = param_body myMail.SaveAs App.Path & "\SentEmail.msg" myMail.Send Set myAttachments = Nothing Set myRecipient = Nothing Set myMail = Nothing |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > save email in Outlook Automation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|