create mailItem

Joined
May 16, 2011
Messages
1
Reaction score
0
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???



 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top