Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
zoolaw444 zoolaw444 is offline
external usenet poster
 
Posts: 15
Default Graham Mayor -- individual merge letters

I copied the code and created Graham Mayor's macro to merge a form letter
merge document directly to individual Word documents and it worked. The only
problem is that the new individual Word documents did not retain the
formatting from the form letter merge. Can anyone help me fix this? If not,
this defeats the whole purpose of using the mail merge because it would take
me less time to type in the names and addresses of all the people I want to
send the letter to than it would to go through each individual document and
reformat it (i.e., paragraph alignment, spacing, etc.)

Cortney
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Graham Mayor -- individual merge letters

I have spoken with Doug (who wrote the macro) about this. His response:

Create a template that has the required settings and then in the
Private Sub app_MailMergeAfterMerge(ByVal Doc As Document, ByVal DocResult
As Document)
routine, replace the line of code:
Set NewDoc = Documents.Add(Visible:=False)
with
Set NewDoc = Documents.Add(Template:="c:\documents and
settings\[username]\application
data\microsoft\templates\[TemplateName].dot", Visible:=False)
Where the [username] is whatever is appropriate for the path to your
templates folder and [TemplateName] is the name of the template that you
created with the required settings.
I think that you should then get the desired result.

--

Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org




zoolaw444 wrote:
I copied the code and created Graham Mayor's macro to merge a form
letter merge document directly to individual Word documents and it
worked. The only problem is that the new individual Word documents
did not retain the formatting from the form letter merge. Can anyone
help me fix this? If not, this defeats the whole purpose of using the
mail merge because it would take me less time to type in the names
and addresses of all the people I want to send the letter to than it
would to go through each individual document and reformat it (i.e.,
paragraph alignment, spacing, etc.)

Cortney



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
zoolaw444 zoolaw444 is offline
external usenet poster
 
Posts: 15
Default Graham Mayor -- individual merge letters

Grahan, I appreciate your prompt response but I'm confused.

First of all, to make sure we're on the same page, this is the macro I'm
using:

Sub SplitMerge()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
' with modifications by Graham Mayor 16-06-03 & 08-10-04

Dim Title As String
Dim Default As String
Dim MyText As String
Dim MyName As Variant
Dim MyPath As String

Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1

Default = "Merged"
MyText = "Enter a filename. Long filenames may be used."
Title = "File Name"
MyName = InputBox(MyText, Title, Default)
If MyName = "" Then
End
End If

Default = "D:\My Documents\Test\"
Title = "Path"
MyText = "Enter path"
MyPath = InputBox(MyText, Title, Default)
If MyPath = "" Then
End
End If

While Counter Letters
Application.ScreenUpdating = False
Docname = MyPath & LTrim$(Str$(Counter)) & " " & MyName & ".doc"

ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub

Is it here in the macro code itself that I need to replace the line of code
you indicated? If so, I don't see the "Private Sub
app_MailMergerAfterMerge(ByVal Doc As Document, ByVal DocResult As Document)"
part that you said to replace. If not, then please tell me where to find this
in order to replace it because... I'm a total beginner here.

Your help is GREATLY appreciated!
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Graham Mayor -- individual merge letters

You are right - we are not on the same page. I asumed that yuou meant Doug's
add-in about which this issue has come up before. The principle is still the
same however especially as this macro was developed from another of Doug's
.

Find the line
Documents.Add
and
change it to
Documents.Add(Template:="c:\path\[TemplateName].dot")
substituting the path and template name as indicated in Doug's suggestion.

That hopefully will do the trick.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



zoolaw444 wrote:
Grahan, I appreciate your prompt response but I'm confused.

First of all, to make sure we're on the same page, this is the macro
I'm using:

Sub SplitMerge()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created
by a ' mailmerge as a separate file.
' with modifications by Graham Mayor 16-06-03 & 08-10-04

Dim Title As String
Dim Default As String
Dim MyText As String
Dim MyName As Variant
Dim MyPath As String

Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1

Default = "Merged"
MyText = "Enter a filename. Long filenames may be used."
Title = "File Name"
MyName = InputBox(MyText, Title, Default)
If MyName = "" Then
End
End If

Default = "D:\My Documents\Test\"
Title = "Path"
MyText = "Enter path"
MyPath = InputBox(MyText, Title, Default)
If MyPath = "" Then
End
End If

While Counter Letters
Application.ScreenUpdating = False
Docname = MyPath & LTrim$(Str$(Counter)) & " " & MyName & ".doc"

ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub

Is it here in the macro code itself that I need to replace the line
of code you indicated? If so, I don't see the "Private Sub
app_MailMergerAfterMerge(ByVal Doc As Document, ByVal DocResult As
Document)" part that you said to replace. If not, then please tell me
where to find this in order to replace it because... I'm a total
beginner here.

Your help is GREATLY appreciated!



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
zoolaw444 zoolaw444 is offline
external usenet poster
 
Posts: 15
Default Graham Mayor -- individual merge letters

If I understood your directions correctly, I didn't do it right.

I went in to edit the SplitMerge Macro. Where it said Documents.Add in the
code, I replaced it with Documents.Add(Template:="c:\Documents and
Settings\Cortney\Application Data\Microsoft\Templates\Letter.dot"). The code
was in red and I got a syntax error message when I tried to run the macro.

Any suggestions?


  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Graham Mayor -- individual merge letters

Plan B

Documents.Add("c:\Documents and Settings\Cortney\Application
Data\Microsoft\Templates\Letter.dot").

You will need a template without content - containing only the paragraph
styles used in the original template.


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




zoolaw444 wrote:
If I understood your directions correctly, I didn't do it right.

I went in to edit the SplitMerge Macro. Where it said Documents.Add
in the code, I replaced it with Documents.Add(Template:="c:\Documents
and Settings\Cortney\Application
Data\Microsoft\Templates\Letter.dot"). The code was in red and I got
a syntax error message when I tried to run the macro.

Any suggestions?



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
Save mail merge as individual letters. Bell Mailmerge 10 September 27th 06 09:30 PM
Mail merge in form letters from Access traderjh Mailmerge 3 September 20th 06 03:54 PM
After merge I need to see the letters under the prompt box to edit CheyWyShyGirl Mailmerge 1 June 23rd 06 10:58 PM
only one page of mail merge document is printing Pawprintsx4 Microsoft Word Help 11 November 22nd 05 06:15 PM
Query a mail merge for multiple letters at once? Brese Mailmerge 1 May 20th 05 02:10 PM


All times are GMT +1. The time now is 10:19 AM.

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

About Us

"It's about Microsoft Word"