New messages ending up in Inbox instead of Draft

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
 
M

Michael Bauer [MVP - Outlook]

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:
 
D

Dmitry Streblechenko

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
 

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