![]() |
#1
|
|||
|
|||
![]()
For ActiveDocument.ExportAsFixedFormat, there seems four options regarding page ranges:
wdExportAllDocument wdExportCurrentPage wdExportFromTo wdExportSelection Is there a way to set non-consecutive page ranges such as, "2, 4-7"? Any help is appreciated. |
#2
|
||||
|
||||
![]()
The short answer is no, but you could download and install PrimoPDF, which works as a 'printer driver' and thus allows the use of the printer dialog selections which do allow non-consecutive page selections.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
![]()
An alternative would be to format the content of the pages to be excluded as hidden, save the PDF - which won't include those pages - then undo the hidden formatting (e.g. by closing the document without saving the changes).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]()
Thank you both.
I have a need to print only the pages that contain revisions into a PDF file. So far I tried three approaches with none very satisfactory. The first approach is copy and paste all pages containing revisions into a new document and save as PDF. The advantage is that all the "revision" footnotes and endnotes can all be pasted into the new document no matter if the footnote spans pages or the endnote don't appear on the same page as its reference number. The bad thing is that all the footnotes/endnotes would automatically renumbered. The second approach is to use a PDF printer, which could keep all the original numbers of both footnotes/endnotes, but cannot deal with cases a footnote spans more than one pages and endnotes don't appear on the same pages as their reference numbers. I can set the body text to exact line spacing to get the footnotes as much as within the same page, but cannot find any way to determine the actual page numbers the endnotes would appear. The third approach is similar to what Macropod suggests - all the non-revision pages (including non-revision body text and non-revision footnotes/endnotes) are excluded as hidden text. So far so good until Save as PDF no longer works! The text is hidden in Word as desired, but simply it wont proceed to save as PDF. I'm not sure is it's a problem with Acrobat or Word. I tried my code with Office 2013, and it's fine, but not with Office 2010. I googled a lot, but has nothing. Appreciate if anyone can shed any light. |
#5
|
||||
|
||||
![]()
The SaveAs PDF works for me with hidden content - the save works and the hidden content is excluded. Do note that, if you hide pages, the page range for saving will change.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Hi Macropod,
My code also works, but not for every document. For those documents it doesn't work with Office 2010, it does work with Office 2013. I suspect it's due to too many footnotes as hidden text, and the hidden text in the main body accounts for almost 95% of the entire document? the symptom is the text can be set as hidden as desired, but it won't proceed when saving as PDF. There is no error message. Can you please try your code with the document as attached in Office 2010? (please pardon me as I have to scramble the content). I just made two revisions in the main body and one in the footnote. Thanks. |
#7
|
|||
|
|||
![]()
(continued)
It needs to check the main text, footnotes, endnotes and textboxes of any particular page, and hides all non-revision pages and non-revision footnotes/endnotes. |
#8
|
||||
|
||||
![]()
You hadn't mentioned footnotes & endnotes before. Any attempt to simply hide those creates more problems. You might do better to use Track-Changes and temporarily delete the unwanted ranges; otherwise, use a PDF 'printer' to output just the required pages.
FWIW, Adobe Acrobat Pro 8 is available as a free download from http://www.techspot.com/downloads/46...at-8-free.html - note the serial# mentioned there. Updates, to bring it up to 8.3.1 are available from: ftp://ftp.adobe.com/pub/adobe/acrobat/win/8.x/ Note 1: If you install the updates, you need to install them in order (8.1.0>8.1.1, etc.) and, although three of them will prompt to reboot, you don't need to do so until all of the updates are installed. Your AV software may also mis-identify a print spooler in the last few updates as potential viruses - just tell it to accept them as legit. Note 2: If you want to use Adobe Acrobat Pro 8 as a Print Driver, you'll need to go to Start>Devices and Printers>Adobe PDF>Right-Click>Printer Properties>Advanced, then click the 'Print Directly to Printer' radio button.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Thank you!
The downside of using the PDF printer is the difficulty to determine if a footnote spans pages and the actual page number an endnote is on. |
#10
|
||||
|
||||
![]()
Even if you specify a page range to save via the Save As method, that won't account for footnotes & endnotes that extend beyond that range. Unless you do some document re-formatting before saving/printing, there is always a risk that the end of a preceding note will appear on the first page and that the note on the last page will be incomplete.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Albus | Word | 12 | 12-12-2014 01:36 PM |
Save Every 2 pages of Word Document as the First Line of Text | Faugs | Word VBA | 6 | 08-13-2014 11:50 PM |
![]() |
Jack Byrindi | Word | 9 | 01-21-2014 09:36 PM |
Select specific pages to print or save | Jack Byrindi | Word VBA | 0 | 01-16-2014 03:14 PM |
How to save Pages doc as WORD doc? | pamela | Word | 2 | 11-11-2010 06:20 AM |