View Single Post
 
Old 08-13-2021, 03:41 AM
RobertDany RobertDany is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Jul 2021
Posts: 22
RobertDany is on a distinguished road
Default Save pages range as PDF by input box

Hello everyone,

This VBA code export the range of pages in pdf format, but you need to insert the range manually in the VBA editor window for each run of the code which may be annoying

Code:
Sub SavePageRangeAsPDF()

    ActiveDocument.ExportAsFixedFormat _
     OutputFileName:=CurrentFolder & "Robert" & ".pdf", _
     ExportFormat:=wdExportFormatPDF, _
range:=wdExportFromTo, From:=2, To:=4

End Sub
According to the previous code, how to design an input box which asks me to enter the range that I want to export such as: 5-8 or 5,9,12 or 1-7,12.

Thanks in advance
Reply With Quote