Sending an email from Access to Outlook in a specific folder

D

Daniel Lamarche

Hello. I created a small application using Access 2K that sends emails using
Outlook 2K. Until recently everything went fine. Something was changes in
the Exchange server and all email are automatically sent without the user
having the chance to review it.

It happens often that the user needs to make small custom modifications to
the email before sending it. My idea was that perhaps the Access code could
sent all emails to a folder other than the default Outbox folder. Now the
person could review them before moving them to the Outbox. This is the code
that I use:

Public Sub SendReceipt(strCorrespondentTitle As String, _
strCorrespondent As String, _
strCorrespondentLang As String, _
strEmail, _
strAuthorList As String)

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

Dim strManuscriptName As String
Dim strMessageSubject As String
Dim strMessageBody As String

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

strMessageBody = strMessageBody & "Message here"

With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(strEmail)
.Subject = strMessageSubject
.HTMLBody = strMessageBody
.SaveAs
.Send ' <---- Probably need to
change this!
End With

Set objOutlookRecip = Nothing
Set objOutlookMsg = Nothing
Set objOutlook = Nothing

End Sub

Is there a way that I can stop the email from being sent and create it into
another folder instead?

Thank you very much.

Daniel Lamarche
 
S

Sue Mosher [MVP]

Try replacing Send with Display to show the item or Save to save it to the Drafts folder.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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