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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ").GetDefa ultFolder _
(olFolderDrafts)
Set myOlExpl = myExplorers.Add _
(myFolder, olFolderDisplayNoNavigatio n)
myOlExpl.Display
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
(olFolderDrafts)
Set myOlExpl = myExplorers.Add _
(myFolder, olFolderDisplayNoNavigatio
myOlExpl.Display
ASKER
Thanx, it works perfectly
.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.