Sub Test() With ActiveDocument.PDFSettings .PublishRange = pdfPageRange .PageRange = "1-3" End With ActiveDocument.PublishToPDF "C:\MyDocument.pdf"End Sub