Data Extract by page and Save

A

Allen

I was wondering how to approach (and some guidance) on the following dilema.

I have a Word document that is broken out by geographic region (each page in
the document is it's own regional report, about 150 pagers, -- RTF export
from Crystal Reports). I need to be able to email each branch just their
data.

Its been manually hand-stuffed into envelopes in the past and would like to
get away from that, but not sure how to approach this without adding another
level of manual labor by saving each branch's page individually and e mailing
it off. Automating just the extract of each page and saving as a different
document would be a great start.

Any help on the matter would be greatly appreciated.
 
D

Doug Robbins - Word MVP

The following macro will save each page as a separate document:

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

'

Dim Counter As Long, Source As Document, Target As Document

Set Source = ActiveDocument

Selection.HomeKey Unit:=wdStory

Pages = Source.BuiltInDocumentProperties(wdPropertyPages)

Counter = 0

While Counter < Pages

Counter = Counter + 1

DocName = "Page" & Format(Counter)

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

Set Target = Documents.Add

Target.Range.Paste

Target.SaveAs FileName:=DocName

Target.Close

Wend

End Sub

And, with a bit more work integrating, you could use the information in the
following article to send each document as an attachment to a mailmerge:

"Mail Merge to E-mail with Attachments" at

http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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