Sheils
asked on
Splitting Mail Merged Documents in Word using Macro code?
an anyone tell me how to write - using text - a macro in word - I have code that will split a mail merge into individual docs but don't know how to use it?
Sub Splitter()
Selection.EndKey Unit:=wdStory
numlets = Selection.Information(wdActiveEndSectionNumber)
If numlets > 1 Then numlets = numlets - 1
Selection.HomeKey Unit:=wdStory
BaseName = "c:\Let"
For Counter = 1 To numlets
DocName = BaseName & Right("000" & LTrim(Str(Counter)), 3)
ActiveDocument.Sections.First.Range.Cut
Documents.Add
Selection.Paste
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
ActiveDocument.SaveAs FileName:=DocName
ActiveWindow.Close
Next Counter
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No waste of time.
I thought it was an interesting question.
If you post the solution you can ask that your own answer be accepted instead of mine.
I am interested in the resolution.
(Remember, I don't need the points)
;-)
Besides, my post was not a solution, so I don't deserve any points anyway...
;-)
Jeff
I thought it was an interesting question.
If you post the solution you can ask that your own answer be accepted instead of mine.
I am interested in the resolution.
(Remember, I don't need the points)
;-)
Besides, my post was not a solution, so I don't deserve any points anyway...
;-)
Jeff
ASKER
My apology. This is a question that a friend of mine was working on. I believe that she has already sorted it out. Sorry for wasting your time
Regards
SB9