Link to home
Start Free TrialLog in
Avatar of timofeia
timofeia

asked on

How to put E-mail message and attachments into Drafts folder?

I have the code:
    Dim a As Outlook.Application
    Dim b As Outlook.MailItem
    Set a = New Outlook.Application
    Set b = a.CreateItem(olMailItem)
    With b
        .To = mstrEMail
        .Subject = "Commission Report"
        ' .BCC = "someemail2@whatever.com" '
        .Attachments.Add oFolder.Path & "\" & oFile.Name
        .Body = "Attached is your Commission Report."
        '.Send
    End With
I don't want to send. I want to put everything into the Drafts folder first. How can I do it?
Avatar of rkot2000
rkot2000

you can try
.save

Saves the Outlook item to the current folder or, if this is a new item, to the Outlook default folder for the item type.

Syntax

object.Save

object   Required. An expression that returns an Outlook item object that is listed in the "Applies To" list.
ASKER CERTIFIED SOLUTION
Avatar of rkot2000
rkot2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richie_Simonetti
maybe you need to create message in drafts forlder:
see this as a guide:

Dim myOlApp As New Outlook.Application
Dim myExplorers As Outlook.Explorers
Dim myOlExpl As Outlook.Explorer
Dim myFolder As Outlook.MAPIFolder
Set myExplorers = myOlApp.Explorers
Set myFolder = myOlApp.GetNamespace("MAPI").GetDefaultFolder _
    (olFolderDrafts)
Set myOlExpl = myExplorers.Add _
    (myFolder, olFolderDisplayNoNavigation)
myOlExpl.Display
Avatar of timofeia

ASKER

Thanx, it works perfectly