Printing Doc Sections to PDF

D

Dylan

Hi, I'm using the following macro to print a mailmerged document's sections
to PDF Files.

How do I call a text value from each section, e.g. the 65th word (the last
word on the fifth row of the table) and depending whether i = an Odd or Even
number call the document "Report" or "Appendix A" respectively?

So that the filename is something like "11125 Report.PDF", or "11125
Appendix A.PDF"

Sub PrintSections()

Dim i As Long
For i = 1 To ActiveDocument.Sections.Count
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" &
i, _
OutputFileName:=(i & ".jpg")
Next i

End Sub

Thank you
DDawson
 
D

Dylan

Can you please tell me why I can't open the PDFs outputted from this macro.

Sub PrintSections()

Dim i As Long
For i = 1 To ActiveDocument.Sections.Count
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" &
i, _
OutputFileName:=(i & ".pdf")
Next i

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top