How to Quickly Attach the Specific Pages of a Word Document to an Outlook Email

MS Word has a direct feature supporting users to send the current Word document as an email attachment. But sometimes, you may only hope to attach the specific pages of a Word document to an Outlook email. Now, this article will share you a method.

To send an entire Word document as email attachment in MS Word application, you can simply go to “File” menu and shift to “Save & Send” tab, under which you can find a “Send as Attachment” button. Yet, at times, what you want to send may be only specific pages of the document. In this situation, you can use the method introduced in the followings to accomplish it.

Quickly Attach the Specific Pages of a Word Document to an Outlook Email

Attach the Specific Pages of a Word Document to an Email

  1. First off, you should open the source Word document whose specific pages you want to send in email.
  2. Then, after getting into the MS Word window, you need to press “Alt + F11” key buttons.
  3. Next, you will get access to the VBA editor in MS Word.
  4. After that, you have to enable “Microsoft Outlook Object Library”. You can hit “Tools” > “Reference” to achieve it.
  5. Subsequently, you ought to copy the following VBA code into a module that is not in use.
Sub AttachSpecificPagesToOutlookEmail()
    Dim strDocumentName As String
    Dim objSelectedPages As Word.Range
    Dim objTempDocument As Word.Document
    Dim objTempRange As Word.Range
    Dim i As Long
    Dim strTempDocument As String
    Dim objOutlookApp As Outlook.Application
    Dim objMail As Outlook.MailItem
 
    strDocumentName = Left(ActiveDocument.Name, InStr(ActiveDocument.Name, ".") - 1)
 
    'Copy the contents from Page 2 to 4
    'You can change the page as per your own needs
    Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=2
    Set objSelectedPages = Selection.Range
    Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=4
    objSelectedPages.End = Selection.Bookmarks("\Page").Range.End
    objSelectedPages.Select
    objSelectedPages.Copy
 
    'Paste the copied contents into a new Word Document
    Set objTempDocument = Word.Application.Documents.Add
    objTempDocument.Activate
    Set objTempRange = objTempDocument.Range(0, 0)
    objTempRange.PasteAndFormat (wdFormatOriginalFormatting)

    For i = objTempDocument.Paragraphs.Count To 1 Step -1
        If Len(objTempDocument.Paragraphs(i).Range) = 1 Then
           objTempDocument.Paragraphs(i).Range.Delete
        Else
           Exit For
        End If
    Next i
 
    'Save this document
    strTempDocument = "E:\" & strDocumentName & " (Excerpt).doc"
    objTempDocument.SaveAs2 strTempDocument, wdFormatDocument
 
    'Attach the new document to a new Outlook email
    On Error Resume Next
    Set objOutlookApp = GetObject(, "Outlook.Application")
    If objOutlookApp Is Nothing Then
       Set objOutlookApp = CreateObject("Outlook.Application")
    End If
 
    Set objMail = objOutlookApp.CreateItem(olMailItem)
    objMail.Attachments.Add (strTempDocument)
    objMail.Display
 
    objTempDocument.Close False
    Kill strTempDocument
End Sub

VBA Code - Attach the Specific Pages of a Word Document to an Email

  1. Finally, you can run this macro. Just press F5 key button or tap on the “Run” icon in the toolbar.
  2. After the macro finishes, a new Outlook email will display, which is attached with an excerpt of the source Word document, like the following screenshot:New Email

Extract Maximum Data from Corrupt Outlook File

If you’ve used Outlook for decades, you may have been confronted with various Outlook issues, including popup inner error messages, sudden crashes as well as serious file damage. Due to the fact that the Scanpst, inbuilt repair tool, can only deal with the small problems, you had better keep an external powerful fix tool handy, say DataNumen Outlook Repair. It is able to draw out maximum data from the damaged Outlook data file.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql fix and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.