Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-07-2021, 12:48 AM
smj.javid smj.javid is offline Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Windows 10 Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Office 2019
Novice
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup
 
Join Date: Oct 2021
Posts: 3
smj.javid is on a distinguished road
Default Save a range of pages as PDF/New Word file with SaveAs Dialog box popup

Hello Everyone,



I am looking for a VBA code which will help me to save a range of pages as PDF and separate new word document with Save As dialog popup.

Thanks in advance
Reply With Quote
  #2  
Old 10-09-2021, 08:33 PM
gmayor's Avatar
gmayor gmayor is offline Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Windows 10 Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

You need to be more specific about what you are trying to do, but reading between the lines, are you trying to split a mail merged document to PDF? In which case see https://www.gmayor.com/MergeAndSplit.htm
__________________
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-10-2021, 05:03 AM
smj.javid smj.javid is offline Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Windows 10 Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Office 2019
Novice
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup
 
Join Date: Oct 2021
Posts: 3
smj.javid is on a distinguished road
Default

Thanks for your response gmayor...

I intended to convert part of word document file (Specified Page Range) in PDF Format. And I succeeded using below mentioned code.

Sub SavePageRangeasPDF()
'
' SavePageRangeasPDF Macro
'
ActiveDocument.ExportAsFixedFormat _
OutputFileName:=CurrentFolder & "Hello All" & ".pdf", _
ExportFormat:=wdExportFormatPDF, _
Range:=wdExportFromTo, From:=2, To:=11

End Sub

In this similar way I want to save a duplicate copy of a word file (Specified Page Range) in docx format with SaveAs Dialogue box pop up to change the file name.

Please help me in generating a code for this
Reply With Quote
  #4  
Old 10-11-2021, 04:11 AM
gmayor's Avatar
gmayor gmayor is offline Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Windows 10 Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

Word doesn't offer that ability.

There are no 'pages' in a Word document. Documents comprise various story ranges with text flowed between the margins. It is not a page layout application. PDF creation is essentially a print process, for which Word does offer that facility.
A possible approach would be to delete the unwanted pages then save with a new name, but beware. What Word considers a 'page' is somewhat flexible and will change as you delete other parts.
__________________
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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save pages range as PDF by input box RobertDany Word VBA 4 08-14-2021 01:25 AM
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup save dialog box promt doesn't save file brmveen Word VBA 2 11-04-2015 12:51 AM
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup Save a range of pages as PDF gn4619 Word VBA 9 10-27-2015 02:11 PM
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup How to suppress saveas dialog from VB6 steveneashcraft Word VBA 15 05-09-2014 07:01 AM
Save a range of pages as PDF/New Word file with SaveAs Dialog box popup How to deactivate File Save dialog box KIM SOLIS Word 3 12-15-2013 12:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 PM.


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