VBA Help Email that will save as draft and send as attachment

Status
Not open for further replies.

BlackOps

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
Hi people. Would need some help with vba in outlook.
Currently i have a macro that detect emails send to external and will do a prompt that ask if the email is checked. Would want to work on having the vba script to check on the email sent and in a prompt, ask the user if he want to send it as an attachment for his supervisor to check, if yes, the email will be save as draft and forwarded out, else the email will not be sent.
Best case would be if the script can detect if there is an attachment, if yes, ask if he would like to forward to his supervisor to check, if not, no action taken. Also if there is no attachment, it will check if this email is send to external, if yes, does a prompt if email check, if yes proceed to send.
 
You'd start with the macro at Check for missing attachments before sending a message - it shows how to check for attachments. (Remove the first If and last End if, change .count = 0 to .count > 0)
Do something like this in the cancel line (that should send as forward, not forward a draft tho - will need to create a new item and attach the draft) -
If answer = vbNo Then Cancel = True
fw = item.forward
fw.to = "boss@domain.com"
fw.send
End If
 
This works... but the recipient needs to use Resend Message to send it (at least my test recipient did.) It's in the sent folder as a draft attached to the message.

Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
        If Item.Attachments.Count > 0 Then
          answer = MsgBox("Do you want to send this for approval?", vbYesNo)
          If answer = vbYes Then Cancel = True
          Item.Save
          Set fw = Application.CreateItem(olMailItem)
            fw.To = "boss@domain.com"
            fw.Subject = "Needs Approved"
            fw.Attachments.Add Item
            fw.Send
Item.Delete
        End If
End Sub
 
Great help Diane. This is the code i am looking for.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
S Outlook Email Help: Select custom voting button options VBA Outlook VBA and Custom Forms 1
S Email Help: Sending Outlook email from Excel VBA Outlook VBA and Custom Forms 6
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
J Need Help with Contacts VBA Outlook VBA and Custom Forms 1
A Help with VBA please! Outlook VBA and Custom Forms 15
G Message template / custom forms and VBA Help needed - inserting info into table Outlook VBA and Custom Forms 3
M VBA SWcript Help Required Using Outlook 1
R [VBA] complicated(?) outlook events - need help with code Using Outlook 15
R VBA Macro to VBScript in a form- Help Please! Using Outlook 10
F No Attachment Warning - VBA Code HELP Outlook VBA and Custom Forms 1
C Beginner Needs VBA Help in Modifying Code Outlook VBA and Custom Forms 2
P VBA help window: Multiple windows/tabs, bookmarks, bookmarks/historypane Outlook VBA and Custom Forms 4
C VBA in "New Outlook?" Using Outlook 0
efire9207 VBA Outlook Contacts Outlook VBA and Custom Forms 6
B Requesting VBA code to make Outlook prompt for confirmation when deleting a task? Outlook VBA and Custom Forms 4
M Outlook 365 VBA Auto-Forward Only the first of Duplicate Emails Outlook VBA and Custom Forms 2
N VBA Code Not Working correctly Outlook VBA and Custom Forms 1
L VBA to Triage Incoming Email Outlook VBA and Custom Forms 0
J Outlook VBA to send from Non-default Account & Data Files Outlook VBA and Custom Forms 4
H using VBA to edit subject line Outlook VBA and Custom Forms 0
G Get current open draft message body from VBA Outlook VBA and Custom Forms 1
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
M Outlook 2016 outlook vba to look into shared mailbox Outlook VBA and Custom Forms 0
V VBA Categories unrelated to visible calendar and Visual appointment Categories Outlook VBA and Custom Forms 2
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
R Outlook 2019 VBA to List Meetings in Rooms Outlook VBA and Custom Forms 0
geoffnoakes Counting and/or listing fired reminders via VBA Using Outlook 1
O VBA - Regex - remove double line spacing Outlook VBA and Custom Forms 1
D.Moore Strange VBA error Outlook VBA and Custom Forms 4
B Modify VBA to create a RULE to block multiple messages Outlook VBA and Custom Forms 0
D Outlook 2021 Using vba code to delete all my spamfolders not only the default one. Outlook VBA and Custom Forms 0
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
D VBA - unable to set rule condition 'on this computer only' Outlook VBA and Custom Forms 5
L Fetch, edit and forward an email with VBA outlook Outlook VBA and Custom Forms 2
BartH VBA no longer working in Outlook Outlook VBA and Custom Forms 1
W Can vba(for outlook) do these 2 things or not? Outlook VBA and Custom Forms 2
MattC Changing the font of an email with VBA Outlook VBA and Custom Forms 1
P MailItem.To Property with VBA not work Outlook VBA and Custom Forms 2
P Tweak vba so it can target another mailbox Outlook VBA and Custom Forms 1
A Outlook 2010 VBA fails to launch Outlook VBA and Custom Forms 2
richardwing Outlook 365 VBA to access "Other Actions" menu for incoming emails in outlook Outlook VBA and Custom Forms 0
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1

Similar threads

Back
Top