E
Epelman
I've a macro that send a draft email to a distribution list. It works ok.
Now I'm trying to do the same with a Visual Studio @008 Vb Com Addin.
The problem is that the email is sent with null .body ...
I d'nt know where is my error.
Please see the code - will appreciate any help
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
MyForwardSend()
End Sub
Private Sub MyForwardSend()
Dim myApp As Outlook.Application
Dim myFolderDrafts As Outlook.MAPIFolder
Dim myForward As Outlook.MailItem
Dim myMail As Object 'Outlook.MailItem
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
myApp = CreateObject("Outlook.Application")
myNameSpace = myApp.GetNamespace("MAPI")
myFolderDrafts =
myNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts)
myMail = myFolderDrafts.Items.Item(myFolderDrafts.Items.Count)
myForward = myMail.Forward
myRecipient = myForward.Recipients.Add("Test") ' add the DL name as
Recipient
myForward.Save()
myForward.Send()
End Sub
Now I'm trying to do the same with a Visual Studio @008 Vb Com Addin.
The problem is that the email is sent with null .body ...
I d'nt know where is my error.
Please see the code - will appreciate any help
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
MyForwardSend()
End Sub
Private Sub MyForwardSend()
Dim myApp As Outlook.Application
Dim myFolderDrafts As Outlook.MAPIFolder
Dim myForward As Outlook.MailItem
Dim myMail As Object 'Outlook.MailItem
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
myApp = CreateObject("Outlook.Application")
myNameSpace = myApp.GetNamespace("MAPI")
myFolderDrafts =
myNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts)
myMail = myFolderDrafts.Items.Item(myFolderDrafts.Items.Count)
myForward = myMail.Forward
myRecipient = myForward.Recipients.Add("Test") ' add the DL name as
Recipient
myForward.Save()
myForward.Send()
End Sub