See it in Action!Watch this video to see this macro in action.
The CodeHere is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Word 16.0 Object Library
'Leverage & Lean "Less Clicks, More Results" Sub CreateEmailSelectedText() ' Means variable is in use Dim objNewEmail As Object ' Dim objOutlookApp As Object ' On Error GoTo LeverageLean 'Create a new email Set objOutlookApp = CreateObject("Outlook.Application") Set objNewEmail = objOutlookApp.CreateItem(olMailItem) objNewEmail.To = "" 'Update to include To Recipients to email objNewEmail.CC = "" 'Update to include CC Recipients to email objNewEmail.Subject = "[Follow Up] " & ActiveDocument.Name objNewEmail.HTMLBody = "<HTML><BODY><span style=""font-family : Calibri;font-size : 11pt"">" & Selection.Text & "</span></BODY></HTML>" objNewEmail.Display Set objNewEmail = Nothing Set objOutlookApp = Nothing Exit Sub LeverageLean: MsgBox (Err.Number & " - " & Err.Description & vbNewLine & vbNewLine & "Don't hesitate to email me: email@example.com") End Sub 'Stay Awesome
Macro MondayHere is the Macro Monday video this macro was featured in. Watch this video to learn how to get the most out of this macro and start using it today!
CustomizationThese lines of code can be customized to personalize this macro.
13. objNewEmail.To = “” Update this code line with any emails that you want populated as a To recipient in the Outlook email that is generated
14. objNewEmail.CC = “” Update this code line with any emails that you want populated as a CC recipient in the Outlook email that is generated
15. objNewEmail.Subject = “[Follow Up] ” & ActiveDocument.Name The Outlook email’s subject will be populated with the text indicated in this code line. By Default, this will be “[Follow Up] Active Document’s Name”
16. objNewEmail.HTMLBody = “” & Selection.Text & ““ The email body is populated with the text that you have selected in the Active Word document. You can add additional text by making updates to this code line