Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Save each Word page as a separate document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
quartz - 31 Jan 2005 21:59 GMT
Is it possible using VBA to create a separate Word file based on each page in
a larger Word document?

The larger document has many pages with headers and footers. Is it possible
to use the "Print to file" option? If so, how? If not, how can this be done
in VBA?

Thanks in advance.
Charles Kenyon - 31 Jan 2005 22:30 GMT
The following page may give you a start.
http://www.gmayor.com/individual_merge_letters.htm

Because you have different headers/footers, it will be more complicated.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Is it possible using VBA to create a separate Word file based on each page
> in
[quoted text clipped - 7 lines]
>
> Thanks in advance.
Doug Robbins - 02 Feb 2005 00:06 GMT
Sub splitter()

'

' splitter Macro

' Macro created 16-08-98 by Doug Robbins to save each page of a document

' as a separate file with the name Page#.DOC

'

Selection.HomeKey Unit:=wdStory

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)

Counter = 0

While Counter < Pages

   Counter = Counter + 1

   DocName = "Page" & Format(Counter)

   ActiveDocument.Bookmarks("\Page").Range.Cut

   Documents.Add

   Selection.Paste

   ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _

       wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _

       True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _

       False, SaveNativePictureFormat:=False, SaveFormsData:=False, _

       SaveAsAOCELetter:=False

   ActiveWindow.Close

Wend

End Sub

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Is it possible using VBA to create a separate Word file based on each page
> in
[quoted text clipped - 7 lines]
>
> Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.