Senin, 30 November 2015

[MS_AccessPros] Re: Sending email from Access

 

Hello Jim

Whilst I'm new to this, and there are members of the forum who will no doubt solve you problem easily, you post tempted me to reply.
I have code that allows a user to fire up Outlook, create an email, edit it and then send.  It doesn't go into the Outbox first.  Here it is (which is very similar to your post)

    ' Get a pointer to Outlook - late binding

    Set objOL = CreateObject("Outlook.Application")

    Set objMail = objOL.CreateItem(olMailItem)

    objMail.Subject = strSubject

    objMail.To = strTo

    objMail.BodyFormat = olFormatHTML

    objMail.Body = strMsg

    objMail.Display

 

    Set objMail = Nothing

    Set objOL = Nothing


The only difference I can see is the use of CreateObject and the above doesn't use a With loop.  If this works for you, great, though perhaps someone could explain why it works.

Best regards
Ray



__._,_.___

Posted by: rayfrew@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar