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.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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
 

BlackOps

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server 2010
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
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
S vba outlook search string with special characters Outlook VBA and Custom Forms 1
S VBA search string with special characters Outlook VBA and Custom Forms 0
U Outlook 2019 VBA run-time error 424 Outlook VBA and Custom Forms 2
DDB VBA to Auto Insert Date and Time in the signature Outlook VBA and Custom Forms 2
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 10
G VBA to save selected Outlook msg with new name in selected network Windows folder Outlook VBA and Custom Forms 1
F Excel VBA to move mails for outlook 365 on secondary mail account Outlook VBA and Custom Forms 1
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
K Outlook Office 365 VBA download attachment Outlook VBA and Custom Forms 2
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
N Save selected messages VBA does not save replies and/or messages that contain : in subject Outlook VBA and Custom Forms 1
V vBA for searching a cell's contents in Outlook and retrieving the subject line Outlook VBA and Custom Forms 1
B vBA for exporting excel file from outlook 2016 Outlook VBA and Custom Forms 3
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
S Excel vba code to manage outlook web app Using Outlook 10
H Custom Outlook Contact Form VBA Outlook VBA and Custom Forms 1
S Problem Checking the available stores in my Inbox (Outlook VBA) Outlook VBA and Custom Forms 0
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
O VBA Cases with Listbox - Can you use Multi-Select? Outlook VBA and Custom Forms 4
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
V Modifying the built in forms with VBA Outlook VBA and Custom Forms 4
S Excel VBA and shared calendar issue Outlook VBA and Custom Forms 3
L Macro/VBA to Reply All, with the original attachments Outlook VBA and Custom Forms 2
L VBA unknown character Outlook VBA and Custom Forms 2
G Move tasks up/down todo list by VBA Outlook VBA and Custom Forms 1
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
K Use VBA to find Sender and Recipient from Microsfot 365 Journaled Email Items Outlook VBA and Custom Forms 3
J Want to learn VBA Macros for Outlook. What book can you recommend? Outlook VBA and Custom Forms 2

Similar threads

Top