I'm new in programing and have to develop an application to create a mail item and then browse to add some files, but I'm having problems when creating the new mail item; I've been looking in MSDN and found this code but can't get to work:
Private Sub creamail()
Dim mailItem As Outlook.MailItem = Me.Application.CreateItem(Outlook.OlItemType.olMailItem)
mailItem.Subject = "This is the subject"
mailItem.To = "(e-mail address removed)"
mailItem.Body = "This is the message."
mailItem.Importance = Outlook.OlImportance.olImportanceLow
mailItem.Display(True)
End Sub
I'm getting "= Me.Application." is not a member of the solution
How can I correct this???
Private Sub creamail()
Dim mailItem As Outlook.MailItem = Me.Application.CreateItem(Outlook.OlItemType.olMailItem)
mailItem.Subject = "This is the subject"
mailItem.To = "(e-mail address removed)"
mailItem.Body = "This is the message."
mailItem.Importance = Outlook.OlImportance.olImportanceLow
mailItem.Display(True)
End Sub
I'm getting "= Me.Application." is not a member of the solution
How can I correct this???