A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

The actual "Merged" Document



 
 
Thread Tools Display Modes
  #1  
Old September 23rd, 2004, 03:42 PM
Preet
external usenet poster
 
Posts: n/a
Default The actual "Merged" Document

Hi

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

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

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

I hope someone can help!

Thanx alot!

Preet x


---
Message posted from http://www.ExcelForum.com/

  #2  
Old September 24th, 2004, 10:10 AM
Doug Robbins
external usenet poster
 
Posts: n/a
Default

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

--
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
"Preet " wrote in message
...
Hi

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

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

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

I hope someone can help!

Thanx alot!

Preet x


---
Message posted from http://www.ExcelForum.com/



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Document Merge Issues Barb Reinhardt General Discussion 1 October 13th, 2004 10:59 AM
Enabling menu commands after protecting a document tdtoolman General Discussion 3 July 6th, 2004 07:21 PM
Word hangs saving new document after merge to access database Sandy Mailmerge 4 May 19th, 2004 03:43 PM
Blank Lines Not Supressing in Merged Document Barbara Mailmerge 1 May 11th, 2004 01:26 AM


All times are GMT +1. The time now is 06:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.