Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can I Pick out specific pages from a document and save to a file
|
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can I Pick out specific pages from a document and save to a file
You can copy/paste specific pages from one document into a new document.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Iceman" wrote in message ... |
#3
|
|||
|
|||
Hi Iceman,
Yes, you can save specific page as an individual document. Here are 2 cases, each with a macro solution. case 1. Extract Current Page and Save it as a New Document Put cursor at a page you want to save as a file. Press "Alt+ F11" to open VBA editor. Then create a new module and paste the following macro: Sub SaveCurrentPageAsANewDoc() Dim objNewDoc As Document Dim objDoc As Document Dim strFileName As String Dim strFolder As String ' Initialization Set objDoc = ActiveDocument strFolder = InputBox("Enter folder path: ") strFileName = InputBox("Enter file name: ") ' Copy current page. objDoc.Bookmarks("\Page").Range.Select Selection.Copy ' Open a new document to paste the selection. Set objNewDoc = Documents.Add Selection.Paste objNewDoc.SaveAs FileName:=strFolder & "\" & strFileName & ".docx" objNewDoc.Close End Sub Case 2: Extract Each Page and Save it as a New Document Use the same way to create a new module and paste this macro: Sub SaveEachPageAsADoc() Dim objNewDoc As Document Dim objDoc As Document Dim nPageNumber As Integer Dim strFolder As String Dim objFileName As Range ' Initialization Set objDoc = ActiveDocument strFolder = InputBox("Enter folder path he ") ' Copy each page in the document to paste it into a new one. For nPageNumber = 1 To ActiveDocument.ComputeStatistics(wdStatisticPages) Application.Browser.Target = wdBrowsePage ActiveDocument.Bookmarks("\page").Range.Select Selection.Copy Set objNewDoc = Documents.Add Selection.Paste ' Save new doc with the name of "Page" & nPageNumber and get the first 20 characters of the new doc as part of the file name. Set objFileName = objNewDoc.Range(Start:=0, End:=20) objNewDoc.SaveAs FileName:=strFolder & "\" & "Page " & nPageNumber & " " & objFileName & ".docx" objNewDoc.Close Application.Browser.Next Next nPageNumber End Sub This macro saves each page of your document as an individual file. For more detailed information, you can refer to this article: https://www.datanumen.com/blogs/2-qu...word-document/ Hope that helps! Dawnnil Last edited by Dawnnil : April 21st 17 at 05:03 AM |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SAVE AS HOW DO YOU PLACE A FILE IN A SPECIFIC LOCATION | Microsoft Word Help | |||
How to fit a document in a specific number of pages ? | Page Layout | |||
how can i print all the pages of a document that have a specific w | Microsoft Word Help | |||
How can I insert a watermark on specific pages of a document only | Microsoft Word Help | |||
How can I print a watermark on specific pages in a big document? | Microsoft Word Help |