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 / November 2003

Tip: Looking for answers? Try searching our database.

mail merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S.Bronson - 21 Nov 2003 16:36 GMT
I would like to be able to have my users click a button to
merge several different letters without having to open
each document.  Can this be done?  Thanks
Peter Jamieson - 22 Nov 2003 14:12 GMT
Yes, but you will need a macro, and you will need to distribute that macro
to your users.

For example a basic Word VBA macro might be something like:

Sub MergeADocumentToPrinter(DocumentName As String)
Dim oDoc As Word.Document
Set oDoc = Application.Documents.Open(DocumentName)
With oDoc.Mailmerge
 .DataSource.FirstRecord = wdDefaultFirstRecord
 .DataSource.LastRecord = wdDefaultLastRecord
' change the destination as required
 .Destination = wdSendToPrinter
 .Execute
End With
oDoc.Close SaveChanges:=False
Set oDoc = Nothing
End Sub

Sub MergeSeveralFiles()

Call MergeADocumentToPrinter("c:\mymergedocs\first.doc")
Call MergeADocumentToPrinter("c:\mymergedocs\second.doc")
Call MergeADocumentToPrinter("c:\mymergedocs\third.doc")

' etc.

End Sub

Then attach the macro to a button using Tools|Customize|Commands to select
the Macros category, and drag the MergeSeveralFiles macro to a toolbar
button (you might also want to create a new toolbar).

(I haven't tested this one by the way, but you will obviously need to make
modifications.But the thing is that you need to consider how specific or
general your macro needs to be, e.g. whether each user is always performing
the same merges, or what.)

If you haven't used macros before you will find more useful info at

http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm

You will also need to distribute the macro to your users. I suggest you have
a look around the www.mvps.org/word site for other articles on that before
going too much further.

--
Peter Jamieson - Word MVP

> I would like to be able to have my users click a button to
> merge several different letters without having to open
> each document.  Can this be done?  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.