Merge Questions

A

Anon

[Wd 2002]

1. Why, when I quit Word after running a merge, does the program
ask me if I want to save changes to the global template? I did
not knowingly change any template, and cannot imagine what changes
would be in question.

2. Is there any way to have the merge result in multiple separate
letters of a single page instead of one single letter of multiple
separate pages?

3. How can I cause a form document's date field, which is
completed with the system date, to convert to text in each new
merge result? The objective is to avoid having the date change in
the future if the merged result is reopened or reprinted.

TIA
 
J

Jezebel

2. Is there any way to have the merge result in multiple separate
letters of a single page instead of one single letter of multiple
separate pages?

Don't think so.
3. How can I cause a form document's date field, which is
completed with the system date, to convert to text in each new
merge result? The objective is to avoid having the date change in
the future if the merged result is reopened or reprinted.

Use a CreateDate or PrintDate field instead of a simple Date field.
 
D

Doug Robbins - Word MVP

Hi Anon,

The following macro will save each letter created by a mailmerge as a
separate file if you run it when the document created by the mailmerge is
the active document.

Sub splitter()

' splitter Macro

' Macro created by Doug Robbins to save each letter created by a mailmerge
as a separate file.

Dim Letters As Integer, Counter As Integer
Letters = ActiveDocument.Sections.Count
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
DocName = "Myletter" & LTrim$(Str$(Counter))
ActiveDocument.Sections.First.Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.Sections(2).PageSetup.SectionStart = wdSectionContinuous
ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Counter = Counter + 1
Wend

End Sub


Here's another method that I have used that involves creating a separate
catalog type mailmerge maindocument which creates a word document containing
a table in each row of which would be your data from the database that you
want to use as the filename.

You first execute that mailmerge, then save that file and close it. Then
execute the mailmerge that you want to create the separate files from and
with the
result of that on the screen, run a macro containing the following code
and when the File open dialog appears, select the file containing the table
created by the first mailmerge

Dim Source As Document, oblist As Document, DocName As Range, DocumentName
As String
Set Source = ActiveDocument
With Dialogs(wdDialogFileOpen)
.Show
End With
Set oblist = ActiveDocument
Counter = 1
While Counter < oblist.Tables(1).Rows.Count
Set DocName = oblist.Tables(1).Cell(Counter, 1).Range
DocName.End = DocName.End - 1

'Change the path in the following command to suit where you want to save
the documents.
DocumentName = "I:\WorkArea\Documentum\" & DocName.Text
Source.Sections.First.Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.SaveAs filename:=DocumentName, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Counter = Counter + 1
Wend


Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Anon said:
[Wd 2002]

1. Why, when I quit Word after running a merge, does the program
ask me if I want to save changes to the global template? I did
not knowingly change any template, and cannot imagine what changes
would be in question.

2. Is there any way to have the merge result in multiple separate
letters of a single page instead of one single letter of multiple
separate pages?

3. How can I cause a form document's date field, which is
completed with the system date, to convert to text in each new
merge result? The objective is to avoid having the date change in
the future if the merged result is reopened or reprinted.

TIA
 
A

Anon

The following macro will save each letter created by a mailmerge
as a separate file if you run it when the document created by
the mailmerge is the active document. [snip]

Thank you Doug. I don't know how you folks understand and create
these scripts. It's like an unlearnable language to me....
Here's another method that I have used that involves creating a
separate catalog type mailmerge maindocument which creates a
word document containing a table in each row of which would be
your data from the database that you want to use as the
filename. [snip]

Thanks. I actually do not catch the vision here of what you're
suggesting, but I'll work on it :)

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top