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
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
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
TedSch Small vba to kill political email Outlook VBA and Custom Forms 3
E Outlook 365 Outlook/VBA Outlook VBA and Custom Forms 11
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
Z VBA Forward vs manual forward Outlook VBA and Custom Forms 2
J VBA Cannot programmatically input or change Value for User Defined field Using Outlook 1
J VBA for outlook to compare and sync between calendar Outlook VBA and Custom Forms 1
A Any way to force sort by/group by on search results with VBA? Outlook VBA and Custom Forms 1
E Default shape via VBA Outlook VBA and Custom Forms 4
A Change settings Send/receive VBA Outlook VBA and Custom Forms 0
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
E Outlook VBA change GetDefaultFolder dynamically Outlook VBA and Custom Forms 6
justicefriends How to set a flag to follow up using VBA - for addressee in TO field Outlook VBA and Custom Forms 9
M add new attendee to existing meetings with VBA Outlook VBA and Custom Forms 5
D VBA code to select a signature from the signatures list Outlook VBA and Custom Forms 3
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
David McKay VBA to manually forward using odd options Outlook VBA and Custom Forms 1
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 1
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 11
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

Similar threads

Top