Outlook interface??

D

Dean J Garrett

Hello,

We have an Access 2003 app that needs to interface to Outlook Everything is
working fine using the code snippet below, but one of the requirements is to
actually open an Outlook Send message window with the info from the
database. We can't see to find a method function to open the window. Can
anyone say how to do this? Thank you!!

Dim objOutLook As New Outlook.Application
Dim objMessage As MailItem


If Len("" & Me.txtTo) = 0 Then

MsgBox "Input a recipient"

Me.txtTo.SetFocus

Exit Sub

End If


If Len("" & Me.txtSubject) = 0 Then

MsgBox "Input a subject line"

Me.txtSubject.SetFocus

Exit Sub

End If


Set objMessage = objOutLook.CreateItem(olMailItem)


With objMessage

..To = Me.txtTo

..Subject = Me.txtSubject

..Body = Me.txtMessage

..Send

End With


Set objOutLook = Nothing

Set objMessage = Nothing
 
L

Lance.Carter

Dean,

Instead of

..send

try simply to substitute this with

.. display (1)

this works for me. I am very much 'amateur' coder though, so i don't fully
understand it...it should leave you with your draft email ready to
finish/send.

I had trawled the net for help on this myself some while ago and drew a blank.


Hope this helps.

Lance
 

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