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 2004

Tip: Looking for answers? Try searching our database.

The actual "Merged" Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Preet - 23 Sep 2004 15:42 GMT
Hi

I am trying to reference a merged document, hence I have my macro i
the Template, which merges to a seperate document. I then bring thi
merged document (that can be called anything from "FormLetter1" t
"Letters1") into PRINT PREVIEW format.

From here, the user can choose what they want to do i.e. they can clic
on the "x" or File> Close/Exit, and I want not only the print preview t
close but the merged doc, e.g. Letters2 and then the template, BUT
cannot seem to reference this merged document as its name isnt alway
consistent.

I am able to get the doc in print preview format, and close th
template but as the macro is in the template I cannot close it, but a
awaiting the user to click on File > Exit, and once they do tha
everything will close, with NO CHANGES, i.e. the SAVE AS dialogue bo
shouldnt appear!

I hope someone can help!

Thanx alot!

Preet

--
Message posted from http://www.ExcelForum.com
Doug Robbins - 24 Sep 2004 10:10 GMT
Dim maindoc as Document, mergeresult as Document

Set maindoc = ActiveDocument 'before the merge is executed
With maindoc.MailMerge 'etc

' code to execute the merge

End With

'after executing the merge, the result of the merge will be the active
document so use

Set mergeresult as ActiveDocument

' Now you have two document objects defined each of which can be acted upon
independently by reference to either maindoc or mergeresult as appropriate.
e.g.

maindoc.Close wdDoNotSaveChanges

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hi
>
[quoted text clipped - 23 lines]
> ---
> Message posted from http://www.ExcelForum.com/
 
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.