New messages ending up in Inbox instead of Draft

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Outlook 2003 with Exchange 2003. I am using the below code from within
Access to send emails via outlook.

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "(e-mail address removed)"
.Subject = "Subject Here"
.HTMLBody = "This is the body text..."
.Save
End With

The problem is that instead of messages being saved in Draft folder, they
are ending up saved in Inbox. What is the problem and how can I fix it?

Thanks

Regards
 
I don't know what the problem is, but would adding the item directly to the
folder help? Looks like this:

set folder=application.session.getdefaultfolder(olfolderdrafts)
set mail=folder.items.add
mail.subject="test"
mail.save

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 5 Mar 2008 03:22:05 -0000 schrieb John:
 
This is usually an indication that you never log to a profile:

Set objOutlook = CreateObject("Outlook.Application")
set NS = objOutlook.GetNamespace("MAPI")
NS.Logon
....

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top