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 / Mailmerge and Fax / September 2006

Tip: Looking for answers? Try searching our database.

Saving letters individualy after a mail merge (but letter has two pages)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeegnapattni@hotmail.com - 21 Sep 2006 16:01 GMT
Hi all,

I'm trying to use this macro that i found on Graham Mayor's brillient
website, but the problem is that each of my letters is two pages long.
Is there anyway for me to modify this code?

Sub SplitMergeLetter()
' splitter Macro modified to save individual letters with

' information from data source. The filename data must be added to

' the top of the merge letter - see web article.

Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
Application.ScreenUpdating = False
With Selection

  .HomeKey Unit:=wdStory
  .EndKey Unit:=wdLine, Extend:=wdExtend
  .MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

End With
sName = Selection
Docname = "N:\My Documents\" & sName & ".doc"
ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
  .Paste
  .HomeKey Unit:=wdStory
  .MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
  .Delete
End With
ActiveDocument.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend

End Sub

Any help would be greatly appriciated.
Doug Robbins - Word MVP - 21 Sep 2006 20:53 GMT
It should not need modifying UNLESS your mailmerge main document contains
more than one section.  Does the main document contain multiple sections, if
so, do you really need them.

Signature

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

> Hi all,
>
[quoted text clipped - 42 lines]
>
> Any help would be greatly appriciated.

Rate this thread:






 
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.