I want to Populate Popup box while sending any email with attachment.

Status
Not open for further replies.

rohit

Member
Outlook version
Outlook 2013 64 bit
Email Account
Hi Everyone,

I am new in outlook and I want to create a Macro in outlook 2013. If I am attaching anything in email then a popup box should appear with the statement “You are attaching a file. Please check if "XYZ" field available in the attachment” Press YES or NO. Also in the popup box should be one check box If I checked the button then a "statement note" should be include with the email.


For Example:

I am attaching any excel file.

when I clicked on send button then a pup box should populate with "You are attaching a file. Please check if "XYZ" field available in the attachment” In pup box should have one "check box" If I click on check box then a note will include in the mail. I if i click NO them mail should not sent and If i click YES the mail should be send without including any note.
 
See the ItemSend event, which is triggered when you click the Send button. In that event check for item.attachments.count

If the Checkbox is really necessary, you' need to add a MSForm to the VBA project, and add all the controls and their logic to it yourself. I'd recommend using the MsgBox function instead with the buttons Yes, No, and Cancel. That's just one line of code. 'Yes' could be for 'send with note', 'No' for 'send without note, and 'Cancel' for 'don't send'.
 
Thank you Michael for your reply, You are right the MsgBox with the buttons YES, NO and Cancel would be fine. But I have not idea about outlook macro codding of outlook. Can you please make this easy for me.

Thanks in advance.
 
See the ItemSend event, which is triggered when you click the Send button. In that event check for item.attachments.count

If the Checkbox is really necessary, you' need to add a MSForm to the VBA project, and add all the controls and their logic to it yourself. I'd recommend using the MsgBox function instead with the buttons Yes, No, and Cancel. That's just one line of code. 'Yes' could be for 'send with note', 'No' for 'send without note, and 'Cancel' for 'don't send'.


Thank you Michael for your reply, You are right the MsgBox with the buttons YES, NO and Cancel would be fine. But I have not idea about outlook macro codding of outlook. Can you please make this easy for me.

Thanks in advance.
 
Try this, you just need to add the note
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  if item.attachments.count then
    select case  msgbox("bla", vbyesnocancel)
    case vbyes
      'user has clicked on yes, add the note
    case vbno
      'no note
    case vbcancel
       cancel=true
    end select
  endif
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
rohit I want to Populate Popup box while sending any email with attachment Using Outlook 1
C Populate form data into message body Outlook VBA and Custom Forms 1
cbufacchi Outlook 365 Populate custom Outlook Appoint form Outlook VBA and Custom Forms 2
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
D Cannot populate certain UserProperties in Outlook from Excel Outlook VBA and Custom Forms 2
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
A Populate Listbox from Txt File Outlook VBA and Custom Forms 0
A Populate Textbox from Txt File Outlook VBA and Custom Forms 1
M Adding Macro to populate "to" "subject" "body" not deleting email string below. Outlook VBA and Custom Forms 5
Diane Poremsky Outlook VBA: Use a Text File to Populate a ListBox Using Outlook 0
T populate calendar with appointments and send reminders Using Outlook 1
A Populate Excel from Outlook Userform Outlook VBA and Custom Forms 3
J Live Meeting Location populate from body Outlook VBA and Custom Forms 4
A How can I populate a dropdown list? BCM (Business Contact Manager) 4
A Cannot populate IMAP folders Using Outlook 1
S Pre populate subject + body + attachment to already open email in outlook 2007 Using Outlook 2
S Populate textbox values from one form to another form. Using Outlook 0
B Auto Populate From Field Using Outlook 3
G Populate an Outlook 2007 template with spreadsheet data. Outlook VBA and Custom Forms 1
R Populate Form with appointments from Calendar Outlook VBA and Custom Forms 1
J populate word template from Outlook custom form Outlook VBA and Custom Forms 2
G Populate BCC field with all Contacts within a Contact Folder Outlook VBA and Custom Forms 4
M Create new Contacts folder and populate it from Access Outlook VBA and Custom Forms 1
A Macro - Open new message, populate from and subject fields, and message text Outlook VBA and Custom Forms 1
G Macro: Create New Message and Auto populate To Field Outlook VBA and Custom Forms 5
S populate body with Word data Outlook VBA and Custom Forms 7
L how to populate multiple users contacts Outlook VBA and Custom Forms 9
A Populate task field based on value of other field Outlook VBA and Custom Forms 9
J WshShell.Popup does't timeout Outlook VBA and Custom Forms 3
D Prevent popup of "Do you want to save changes?" when closing after opening an appointment to view Outlook VBA and Custom Forms 2
GregS Outlook 365 blocked by Google popup Using Outlook 2
L How do you turn off Outlook contacts "hints" popup Using Outlook 2
I Windows 10 - .msg files on disk show Explorer popup error Using Outlook 5
T Unable to 'Upload a file' using popup 'Browse' button Using Outlook 0
moron save as & file location dialog box popup Outlook VBA and Custom Forms 2
P Country name no longer shows in Phone number popup? Using Outlook 5
P POP mail password popup after I deleted the accopunt Using Outlook 6
L Auto-set followup/reminder popup box for ALL sent emails. Using Outlook 0
M Cannot change category in inbox; Can change it in popup Using Outlook 0
C Disabling "Do you want to save changes?" Meeting Popup? Using Outlook 0
T Outlook 2007 SSL selfsigned certificate how to stop security popup everytime? Using Outlook 10
H Popup asks for password of an email account Using Outlook 1
I Notification/Popup Box not showing on right side Using Outlook 1
W Outlook Desktop alert, notification, popup - turn off programattic Outlook VBA and Custom Forms 1
M Files in "Attach File" popup menu no longer alphabetical Using Outlook 3
H popup window "Location Information" Microsoft Office Outlook 2007 Using Outlook 3
D Suppress Popup Outlook VBA and Custom Forms 1
V CommandBar popup Outlook VBA and Custom Forms 1
D Outlook 2003 stopped working - get they dialog box asking for username & Password Using Outlook 2

Similar threads

Back
Top