Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Imported Access report, need to save as separate docs

The following macro is designed to split a document at each section break,
which is what divides a mailmerge document.

If you were to insert something at the bottom of your access report design
that could be used for an EditReplace in Word, then you could use that
facility to replace that something with a section break and then use this
macro to split the document

Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a mailmerge
' as a separate file, retaining the header and footer information.
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
Set Letter = Source.Sections(i).Range
Set Target = Documents.Add
Target.Range = Letter
Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i
End Sub

For the email merge with attachments, see the article "Mail Merge to E-mail
with Attachments" at:

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

You may also get some other ideas from the "Individual Merge Letters" item
on fellow MVP Graham Mayor's website at:

http://www.gmayor.com/individual_merge_letters.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

"Heidi M" wrote in message
...
I have a report I've created in Access because I needed 2 levels of
grouping - I have a 17-day event where customers could visit several
exhibits each day, so I need to group first by customer, then by
exhibit. The details per exhibit list the dates, number of tickets
ordered per guest, and price per date.

I have sent this to Word because I need to be able to save each
person's report as a separate file, so I can continue on towards a
email merge with attachemnts. The problem is that I can only find
macros that split a general Word document based on a number of pages,
and the file name is a generic "Page 1". The number of pages will
vary from guest to guest and I need to name the file based on the
customer's account number, so I'm looking for one of two things:

Either A) a way to create this multi-level grouping as a mail merge
directly in Word, so I can run the macro I already have to name the
file based on a field contained in the merge, or B) Another way to
export my report from Access so I can separate the file another way.

Any help will be greatly appreciated! (I am somewhat familiar with VB
but not an experienced programmer).



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
separate window for new docs in word deb m Microsoft Word Help 5 October 1st 06 12:59 AM
Can I set up a report in Word using imported data Bob B Page Layout 2 June 8th 06 04:38 PM
Can I use mail merge to create docs that save a separate files? liroberson Mailmerge 1 April 25th 06 05:00 AM
How to save 15 separate docs from "a" to 1 doc on "c" BrendaV Microsoft Word Help 2 March 31st 06 06:30 AM
merge from access report leabee1 Mailmerge 1 October 4th 05 07:42 PM


All times are GMT +1. The time now is 04:49 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"