In today’s post, we want to share with you 2 quick ways to extract individual pages from your Word document.
Sometimes in a Word document, each page may contain quite independent contents, such as a table. And you will probably need to send different tables to different people. Then you will have to save each table that is each page, as a separate file.
The first idea occurs to our mind should be the classic copy-and-paste. Yet, anything involves selection can be annoying sometimes, for to drag and select can easily make one ends with no selection at all. For this reason, we recommend you 2 quick methods using macro to do the job.
Method 1: Extract Current Page and Save it as a New Document
- First and foremost, position your cursor at the page you want to extract.
- Click “Developer” tab and then click “Visual Basic” to invoke the VBA editor. If the “Developer” is not activated, simply press “Alt+ F11” instead.
- Secondly, go to “Normal” project by clicking it.
- Next click “Insert” tab and choose “Module”.
- Double click on the new module to open the editing area.
- Then paste the following codes there:
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 here: ") strFileName = InputBox("Enter file name here: ") ' 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
- Lastly, click “Run” button.
Now there will be 2 input boxes. Enter the path where you want to store the new document on the first input box. And enter the new document name on the second one.
Method 2: Extract Each Page and Save it as a New Document
The following macro will enable you to extract each individual page of a document.
- Firstly, press “Ctrl+ Home” to go to the very beginning of your document.
- Then follow the same steps in method 1 to install and run a macro.
- This time replace the macro with this one:
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 here: ") ' 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
Deal with Word Issues
There are and always will be various Word issues. The point is to learn to fix them properly. The most recommended way is, of course, to get a sophisticated Word recovery tool. You should seize every minute to recover your data before it’s too late.
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupt xlsx and pdf repair software products. For more information visit www.datanumen.com