There are several merge related tutorials on my web site, but for the
immediate issue see
http://www.gmayor.com/individual_merge_letters.htm
Between your link above and the additional two below:
http://www.cpearson.com/excel/clipboar.htm
http://support.microsoft.com/?kbid=212730
I was able to pull the data off the merged document, copy it to the
clipboard, and use for the file name. The file name provides a direct
link to the data in the Access database. I had to use the 'DataObject'
in order to do this which reguired a reference to the Microsoft Forms
2.0 object library. The last link above tell you how to set up the
reference.
Works like a charm. THANKS!!!
,----- [ Modified splitter ]
| Sub Splitter()
| ' splitter Macro
| ' Macro created 16-08-98 by Doug Robbins to save each letter created by a
| ' mailmerge as a separate file.
| ' With minor modifications by Graham Mayor 10-02-03
| ' Modifications by GW on 1-7-04
|
| Dim mask As String
|
| Dim MyDataObj As New DataObject
| Selection.EndKey Unit:=wdStory
| Letters = Selection.Information(wdActiveEndSectionNumber)
| Selection.HomeKey Unit:=wdStory
| Counter = 1
| While Counter < Letters
| 'DocName = "x:\Temp\Workgroup\" & Format(Date, mask) & " " & LTrim$(Str$(Counter))
| ActiveDocument.Sections.First.Range.Cut
| Documents.Add
| Selection.Paste
|
| Selection.EndKey Unit:=wdStory
| Selection.MoveLeft Unit:=wdCharacter, Count:=2
| Selection.Delete Unit:=wdCharacter, Count:=1
| Selection.Delete Unit:=wdCharacter, Count:=1
|
| Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Count:=1, Name:=""
| Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=2, Name:=""
| Selection.Find.ClearFormatting
| With Selection.Find
| .Text = ""
| .Replacement.Text = ""
| .Forward = True
| .Wrap = wdFindContinue
| .Format = False
| .MatchCase = False
| .MatchWholeWord = False
| .MatchWildcards = False
| .MatchSoundsLike = False
| .MatchAllWordForms = False
| End With
| Selection.MoveLeft Unit:=wdCharacter, Count:=2
| Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
| Selection.Cut
| MyDataObj.GetFromClipboard
| mask = MyDataObj.GetText()
| DocName = "x:\Temp\Workgroup\" & mask
| ActiveDocument.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
| ActiveWindow.Close
| Counter = Counter + 1
| Wend
|
| End Sub
`-----
Regards,
Greg Strong