How to export part of a document as a new word document?


D

Daniel Mark

Hello:

Is there a standard way to extract some pages from a existing word document
and export as a new word document?



thank you
-Daniel Mark
 
Ad

Advertisements

G

Graham Mayor

Word is not a page oriented application so exporting 'some pages' can be
problematical. It depends what is on the 'pages'.

The following macro will copy selected text to a new document:

Sub CopySelectedToNewDoc()
On Error GoTo Oops
Selection.Copy
Documents.Add Template:="Normal"
Selection.Paste
End
' ActiveDocument.Save
Oops:
MsgBox "Select the text you wish to copy first!"
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Daniel Mark

Hello Graham:
The following macro will copy selected text to a new document:

Sub CopySelectedToNewDoc()
On Error GoTo Oops
Selection.Copy
Documents.Add Template:="Normal"
Selection.Paste
End
' ActiveDocument.Save
Oops:
MsgBox "Select the text you wish to copy first!"
End Sub
I have no idea of how to use the above macro:)
May you give me some comments?

sorry for bothering you again.
thank you
-Daniel Mark
 
Ad

Advertisements

Joined
Feb 12, 2014
Messages
2
Reaction score
0
Thank you so much for that. Perfectly solved my problem. Ten years later, like a message in a bottle, eh?

Word is not a page oriented application so exporting 'some pages' can be
problematical. It depends what is on the 'pages'.

The following macro will copy selected text to a new document:

Sub CopySelectedToNewDoc()
On Error GoTo Oops
Selection.Copy
Documents.Add Template:="Normal"
Selection.Paste
End
' ActiveDocument.Save
Oops:
MsgBox "Select the text you wish to copy first!"
End Sub


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top