How to apply a button to send email with current Word file attached?
If you need to send an email from a Word document using Outlook and attach the current Word file, you can insert a command button that sends the email with one click - no need to open Outlook manually. This guide shows how to set it up quickly and easily.
Apply a button to send email with the current Word file attached
Apply a button to send email with the current Word file attached
Please follow these steps to accomplish the task in your Word document:
- First, insert a command button. Go to "Developer" > "Legacy Tools" > "Command Button (ActiveX Control)".
Note: If you donβt see the Developer tab in the ribbon, visit: How to show the Developer tab in Word ribbon.
- Select the button, then click "Properties" under the "Developer" tab. In the Properties pane, type the text you want to display on the button in the "Caption" field.
- Close the Properties pane. Then right-click the button and choose "View Code".
- In the "Microsoft Visual Basic for Applications" window, paste the following code between the existing subroutine tags:
Dim xOutlookObj As Object Dim xEmail As Object Dim xDoc As Document Application.ScreenUpdating = False Set xOutlookObj = CreateObject("Outlook.Application") Set xEmail = xOutlookObj.CreateItem(olMailItem) Set xDoc = ActiveDocument xDoc.Save With xEmail .Subject = "Fax-data" .Body = "This is a test email." .To = "yy@addin99.com" .Importance = olImportanceNormal .Attachments.Add xDoc.FullName .Display End With Set xDoc = Nothing Set xEmail = Nothing Set xOutlookObj = Nothing Application.ScreenUpdating = True
Note: You can change the subject, body content, and recipient email address in the code to match your actual message details.
- Save and close the VBA editor. Click "Design Mode" on the Developer tab to turn it off. Now, when you click the command button, an email is automatically created in Outlook with the current Word document attached.
- Finally, click the "Send" button in Outlook to send the message.
Best Office Productivity Tools
Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!
π€ Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...
π Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...
β Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...
π§Ή Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...
β Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...
π Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...
β Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...
π Supports 40+ Languages: Use Kutools in your preferred language β supports English, Spanish, German, French, Chinese, and 40+ others!

Best Office Productivity Tools
Kutools for Word - 100+ Tools for Word
- π€ Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish / Super Translate / AI Redaction / AI Proofread
- π Document Mastery: Split Pages / Merge Documents / Batch Convert to PDF
- β Contents Editing: Batch Find and Replace / Resize All Pictures
- π§Ή Effortless Clean: Remove Extra Spaces / Remove Section Breaks
- β Creative Inserts: Insert Thousand Separators / Insert Check Boxes / Create QR Codes
- π Supports 40+ Languages: Kutools speaks your language β 40+ languages supported!