Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2015, 10:09 AM
gn4619 gn4619 is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Novice
Save a range of pages as PDF
 
Join Date: Apr 2015
Posts: 25
gn4619 is on a distinguished road
Default Save a range of pages as PDF

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.
Reply With Quote
  #2  
Old 10-22-2015, 09:05 PM
gmayor's Avatar
gmayor gmayor is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 10-23-2015, 04:54 AM
macropod's Avatar
macropod macropod is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #4  
Old 10-23-2015, 03:23 PM
gn4619 gn4619 is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Novice
Save a range of pages as PDF
 
Join Date: Apr 2015
Posts: 25
gn4619 is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 10-23-2015, 04:37 PM
macropod's Avatar
macropod macropod is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #6  
Old 10-23-2015, 05:19 PM
gn4619 gn4619 is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Novice
Save a range of pages as PDF
 
Join Date: Apr 2015
Posts: 25
gn4619 is on a distinguished road
Default

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.
Attached Files
File Type: docx ForRevisionPDF.docx (123.6 KB, 21 views)
Reply With Quote
  #7  
Old 10-23-2015, 05:22 PM
gn4619 gn4619 is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Novice
Save a range of pages as PDF
 
Join Date: Apr 2015
Posts: 25
gn4619 is on a distinguished road
Default

(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.
Reply With Quote
  #8  
Old 10-23-2015, 06:35 PM
macropod's Avatar
macropod macropod is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #9  
Old 10-27-2015, 08:29 AM
gn4619 gn4619 is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Novice
Save a range of pages as PDF
 
Join Date: Apr 2015
Posts: 25
gn4619 is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 10-27-2015, 02:11 PM
macropod's Avatar
macropod macropod is offline Save a range of pages as PDF Windows 7 64bit Save a range of pages as PDF Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save a range of pages as PDF Advanced page numbering: section pages in header, document pages in footer 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
Save a range of pages as PDF Tick box to be able to save or print specific pages 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft