What happens if you explicitly declare the OutM variable As MailItem?
--
Best regards
Michael Bauer - MVP Outlook
: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>
Am Tue, 10 Feb 2009 11:04:13 -0800 schrieb MUSIWA:
> Eventually I am trying to send faxes of pdf documents to a hospital
multiple
> times a day. I am just trying this code but I cannot get the .send to
work.
> It throws a syntax error. Can someone please help
>
> Set OutProg = CreateObject("outlook.application")
> Set OutM = OutProg.CreateItem(olitemType.olmailitem)
>
> With OutM
> .subject = "I am trying"
> .To = "emailaddress"
> .body = "Here we go"
> .Importance = Outlook.OlImportance.olImportanceNormal
> MsgBox " done"
> End With
> OutM.Send()?????
> Exit Sub