The PageRange property specifies a range of pages to publish to PDF. To apply this property, the PDFVBASettings.PublishRange property must be specified as pdfPageRange.
Examples:
The following VBA example publishes the first three pages of the active document to PDF.
Sub Test()
With ActiveDocument.PDFSettings
.PublishRange = pdfPageRange
.PageRange = "1-3"
End With
ActiveDocument.PublishToPDF "C:\MyDocument.pdf"
End Sub