Outlook.Send

  • Thread starter Thread starter MUSIWA
  • Start date Start date
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
 
OutM.Send

If you want to use the parentheses use this:

Call OutM.Send()
 
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
 
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?
 
Back
Top