Consulting

Results 1 to 2 of 2

Thread: How to select pages in an document and export as pdf to location

  1. #1
    VBAX Regular
    Joined
    Oct 2018
    Location
    Antwerp
    Posts
    41
    Location

    How to select pages in an document and export as pdf to location

    I have a document of 20 pages.
    Now I want to print a range, as pdf and save in a folder.

    To print the whole doc, it works as:

    Dim sName As String
    Dim sPath As String

    With ActiveDocument
    sName = Left(.Name, InStr(.Name, ".") - 1)
    sName = sName & ".pdf"
    sPath = "C:\Users\wardd\Documents\waitingfolder"


    .ExportAsFixedFormat _
    OutputFileName:=sPath & sName, _
    ExportFormat:=wdExportFormatPDF
    End With


    End Sub

    how select a range? eg page 1-6

    Ward

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You should examine all of the parameters of the
    .ExportAsFixedFormat method; it allows you to specify the pages to export.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •