Help!

Help re sending email

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  creating a shortcut to contacts stored in public ..  
Author Message
MUSIWA
External


Since: Feb 10, 2009
Posts: 1



PostPosted: Tue Feb 10, 2009 11:04 am    Post subject: Help re sending email
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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
Back to top
Michael Bauer [MVP - Outl
External


Since: Aug 04, 2006
Posts: 647



PostPosted: Wed Feb 11, 2009 5:02 pm    Post subject: Re: Help re sending email [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum