Drafts Folder Sending

G

Guest

I am programitically saving emails to the Drafts folder (thus bypassing the
pop-up dialog when you try to send) and now I want to #1 create a rule in
Outlook to send these emails, or #2 code a script to send them. I'd rather
not forward and am unable to redirect. I tried moving em to the Outbox, but
no cookie.


and redemption is a no no.
 
S

Sue Mosher [MVP-Outlook]

Outlook version?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Outlook version?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Outlook 2003 (11.6568....) SP2

Sue Mosher said:
Outlook version?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Outlook 2003 (11.6568....) SP2

Sue Mosher said:
Outlook version?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

A rule only works on new incoming and outgoing items, so it's not a solution for your scenario. You need to write a VBA macro to iterate the items in the Drafts folder, then send each one.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

A rule only works on new incoming and outgoing items, so it's not a solution for your scenario. You need to write a VBA macro to iterate the items in the Drafts folder, then send each one.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Sue: Thanks for the reply.

Can you give me a code example? I've never done any Outlook work and really
don't know where to start. Additionally will a VBA macro invoke the Outlook
security dialog that I'm trying to avoid?


TIA
Harry
 
G

Guest

Sue: Thanks for the reply.

Can you give me a code example? I've never done any Outlook work and really
don't know where to start. Additionally will a VBA macro invoke the Outlook
security dialog that I'm trying to avoid?


TIA
Harry
 
S

Sue Mosher [MVP-Outlook]

Your Outlook version, which you didn't mention, largely determines whether you'll get security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Your Outlook version, which you didn't mention, largely determines whether you'll get security prompts.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Sue: Actually I've got everything except the trigger. I need something to
trigger the script and having the item hit the draft folder doesn't count.
 
G

Guest

Sue: Actually I've got everything except the trigger. I need something to
trigger the script and having the item hit the draft folder doesn't count.
 
S

Sue Mosher [MVP-Outlook]

I don't know what other kind of trigger you might be looking for. You can run a VBA macro from Alt+F8 or add it to the toolbar.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

I don't know what other kind of trigger you might be looking for. You can run a VBA macro from Alt+F8 or add it to the toolbar.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Sorry, I definitely missed it. In that case, all you need to do to avoid security prompts is derive all your objects from the intrinsic Application object in Outlook VBA, e.g.:

Set drafts = Application.Session.GetDefaultFolder(olFolderDrafts)
For Each item in drafts
item.Send
Next

Still don't know what you have in mind re: "trigger."

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for ll
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Sorry, I definitely missed it. In that case, all you need to do to avoid security prompts is derive all your objects from the intrinsic Application object in Outlook VBA, e.g.:

Set drafts = Application.Session.GetDefaultFolder(olFolderDrafts)
For Each item in drafts
item.Send
Next

Still don't know what you have in mind re: "trigger."

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for ll
Administrators, Power Users, and Developers
 
G

Guest

Sue: I need this automated. I'm generating an email with attachments
programmatically and can .save with no security pop to the draft folder. I
put a code at the end of the subject line to id the item and currently have a
rule to detect and then run a script to strip the code and send it.

The issue is the rule only works on incoming msgs and must be run manually.

What I need is an event trigger (like OnSave) to trigger the script to check
for the code at the end of the subject line.

Here's the code:

Sub SendNow(MyMail As MailItem)
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim strID As String
Dim objSub As String
Dim objSubT As String
Dim subLen As Integer

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")

Set msg = olNS.GetItemFromID(strID)
objSub = msg.Subject
subLen = Len(objSub)
objSubT = Left(objSub, (subLen - 6))

MyMail.Subject = objSubT
msg.Send

Set olNS = Nothing
Set msg = Nothing

End Sub
 

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