Outlook.Send

M

MUSIWA

What is the correct syntax to send the message in out look through VBA
object.send cause a syntax error in my computer

Set OutProg = CreateObject("outlook.application")
Set OutM = OutProg.CreateItem(olitemType.olmailitem)

With OutM
.subject = "I am trying"
.To = "My email address"
.body = "Here we go"
.Importance = Outlook.OlImportance.olImportanceNormal
MsgBox " done"
End With
OutM.Send() (syntax error here and am not sure why ????)
Exit Sub
 
K

Ken Slovak - [MVP - Outlook]

OutM.Send

If you want to use the parentheses use this:

Call OutM.Send()
 
M

MUSIWA

See that is just my problem I keep getting the same error
"application _define or object defined error" and debbug shows me that
statement as the problem. Ru time error 287

Did I mess up my defination of the objects?

Thanks by the way sorry for insulting your intelligence
 
K

Ken Slovak - [MVP - Outlook]

Do you have a VBA project reference set to the Outlook version installed
there?

Send is definitely a method of the MailItem object. Do you show either
object in the Object Browser?
 

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