Jump to content

Extract every pages in a word document to new documents


Autreflt

Recommended Posts

Hello,

 

Here is my question. I have a file with engineering drawings, each page with one engineering drawing. And I want to etract each engineering drawing into a new document.

 

Now I can only copy one page and past it in a new document  one by one . Can I have a way to batch do that ? Extract each page and save each one in a new  word document?

 

Thanks in advance.

 
Link to comment
Share on other sites

  • Moderators

G'day autreflt and welcome,

 

unusual forum for such a request, but what the heck. :)

 

what sort of file has the drawings, Word?, PDF? other... ?

how many drawings/pages are we talking?

 

a Batch file is not your answer, look into VBA macros.

to get you started, in Word, on the Ribbon, turn on the Developer tab, in there you'll see Record a Macro, do the process of copying and pasting a drawing into a new document manually.

that way your steps will be recorded.

hit Alt+F11 to go into the the Visual Basic Editor and you'll see your recorded macro, wrap it in a For... Next... loop to repeat for the number of times you want.

Backup now & backup often.
It's your digital life - protect it with a backup.
Three things are certain; Birth, Death and loss of data. You control the last.

Link to comment
Share on other sites

  • Moderators

Presumably these engineering drawings are images embeded into the Word document?

 

So it may be better to extract the images rather than splitting the pages.

 

Saving the document as a webpage is a good, easy trick to extract all the images from a document in one go.

Of course this gives you images not seperate word documents.

 

See here for an explanation of how to do this, and another couple of methods.

http://www.ubergizmo.com/how-to/extract-images-ms-word/

*** Out of Beer Error ->->-> Recovering Memory ***

Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:
https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043

 

Link to comment
Share on other sites

As have metioned above,  you can use VBA to do that, And I just find a macro may help.

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

And I also attach the link in case you need more details.

 

https://www.datanumen.com/blogs/2-quick-ways-extract-individual-pages-word-document/

 

Good luck.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.