Some users long for a solution that allows them to send the specific pages of a Word document as an Outlook email in quick time. In this article, we will introduce such a method in detail.
If you have read my previous article “How to Quickly Attach the Specific Pages of a Word Document to an Outlook Email“, you may tend to ask for a method which can directly send the specific pages of a Word document as an email, rather than as an email attachment. Now, in the followings, we will show you a piece of VBA code, which can realize it with ease.
Send the Specific Pages of a Word Document as an Outlook Email
- To begin with, you need to access the source Word document whose specific pages you want to send.
- Then, in the opened Word window, you should press “Alt + F11” buttons.
- It will bring out the “Microsoft Visual Basic for Applications” window.
- In this window, you should insert a new module.
- Next, you have to enable “Microsoft Outlook Object Library”.
- Click “Tools” and choose “Reference” from drop down list.
- In the popup dialog box, scroll down until you see the “Microsoft Outlook Object Library”. Enable it and click “OK”.
- After that, you can copy the piece of VBA code below into this module.
Sub SendSpecificPagesAsOutlookEmail() Dim objSelectedPages As Word.Range Dim objOutlookApp As Outlook.Application Dim objMail As Outlook.MailItem Dim objMailDocument As Word.Document 'Copy the contents from Page 3 to 4 'Change the page number as per your needs Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=3 Set objSelectedPages = Selection.Range Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=4 objSelectedPages.End = Selection.Bookmarks("\Page").Range.End objSelectedPages.Select objSelectedPages.Copy 'Get Outlook Application On Error Resume Next Set objOutlookApp = GetObject(, "Outlook.Application") If objOutlookApp Is Nothing Then Set objOutlookApp = CreateObject("Outlook.Application") End If 'Create a new email Set objMail = objOutlookApp.CreateItem(olMailItem) objMail.Display 'Paste the contents in specific pages into message body Set objMailDocument = objMail.GetInspector.WordEditor Set objTempRange = objMailDocument.Range(0, 0) objTempRange.PasteAndFormat (wdFormatOriginalFormatting) End Sub
- Eventually, you can run this macro at once. Just press “F5” key button in the current module.
- You may receive an Outlook warning like the following screenshot. You could click “Allow” directly.
- Ultimately, you will get an email which is containing the specific pages of the Word document.
Pay Attention to Outlook Data Protection
You may be considerably satisfied with quantities of functions in Outlook. But, it still contains flaws. For instance, it is susceptible to errors and corruption. In this case, you have to pay much attention to Outlook protection, including backing up your Outlook PST files at regular interval. Besides, it’s prudent and suggested to keep a mighty PST repair utility, like DataNumen Outlook Repair. It is so powerful that it can extract maximum data from seriously corrupted Outlook file.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf repair and outlook repair software products. For more information visit www.datanumen.com