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 / May 2006

Tip: Looking for answers? Try searching our database.

Specify a template when merging?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Colin Halliday - 29 May 2006 07:14 GMT
Is it possible to specify a template to use for the mailmerge document
rather than use the normal template?

If, for example, I wish to use the beforeprint vba event to do some
processing before printing of the merged document, I could build this into a
template and specify that this particular template be used when I generate
the merged document from the form letter document.

Thanks.

Signature

Colin Halliday

Doug Robbins - Word MVP - 29 May 2006 12:07 GMT
There is nothing to stop you creating a document from any template of your
choosing and then using that document as a mailmerge main document.  Rather
than use the Mail Merge Wizard however, you should display the Mail Merge
toolbar, via View>Toolbars and then use the left-hand button on the toolbar
to change the document to a formletter type document.

It may however be one of the mailmerge events that you will need to use,
rather than a before print event, particularly if you want the event to
function during the execution of the merge to the printer.

Otherwise, you could just have the code that you wish to use in an add-in
that you could invoke whenever it is required.

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

> Is it possible to specify a template to use for the mailmerge document
> rather than use the normal template?
[quoted text clipped - 5 lines]
>
> Thanks.
Colin Halliday - 30 May 2006 00:44 GMT
Thanks for the reply, but it is the mailmerge document, not the form letter
that I want to specify a template for; i.e. the document that is created
when you complete the merge to a new document.

Colin

> There is nothing to stop you creating a document from any template of your
> choosing and then using that document as a mailmerge main document.
[quoted text clipped - 18 lines]
>>
>> Thanks.
Doug Robbins - Word MVP - 30 May 2006 04:38 GMT
If you execute the merge to a new document, then you could use the following
macro to split it into individual documents based on the template that you
want to use by specifying the template in the line Set Target =
Documents.Add(Template Name)

Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a mailmerge
' as a separate file, retaining the header and footer information.
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
   Set Letter = Source.Sections(i).Range
   Set Target = Documents.Add
   Target.Range = Letter
   Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous
   Target.SaveAs FileName:="Letter" & i
   Target.Close
Next i
End Sub

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

> Thanks for the reply, but it is the mailmerge document, not the form
> letter that I want to specify a template for; i.e. the document that is
[quoted text clipped - 24 lines]
>>>
>>> Thanks.
 
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.