?
Solved

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

Posted on 2002-04-08
4
Medium Priority
?
151 Views
Last Modified: 2010-05-02
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?
0
Comment
Question by:timofeia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6925594
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.
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 400 total points
ID: 6925601
i just tried save and it's working fine.

Dim a As Outlook.Application
   Dim b As Outlook.MailItem
   Set a = New Outlook.Application
   Set b = a.CreateItem(olMailItem)
   With b
       .To = "me"
       .Subject = "Commission Report"
       ' .BCC = "someemail2@whatever.com" '
       '.Attachments.Add oFolder.Path & "\" & oFile.Name
       .Body = "Attached is your Commission Report."
       .Save
   End With
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6925615
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
0
 

Author Comment

by:timofeia
ID: 6925678
Thanx, it works perfectly
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question