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 / March 2004

Tip: Looking for answers? Try searching our database.

How to save a merged file in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gavin - 08 Mar 2004 17:12 GMT
All,

Need to find a way how to save the merged file.

I have already executed the merge with the following 2 statements...

Object oFalse = false;
wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument;
wrdMailMerge.Execute(ref oFalse);

At this point in time, I have the merged document open in Word. I
think Word has already named the file according to its naming
conventions...
Now, I need to save the merged file in a specific location and with a
specific name.

Any help will be greatly appreciated. I am writing this in C#.

Thank you,

Gavin.
Peter Jamieson - 08 Mar 2004 18:08 GMT
After the merge to a new document, the newly created document should be the
ActiveDocument;whatever the parent object of your wrdMailMerge object should
point to the Mail Merge Main Document which you should be able to close and
discard. This may be complicated a little if there is an Error document.

Signature

Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

> All,
>
[quoted text clipped - 18 lines]
>
> Gavin.
Curtis Justus - 08 Mar 2004 22:10 GMT
Hi,

One way you can do it is to handle the MailMergeAfterMerge event.  One of
the arguments is the resulting document.  You can then do a .SaveAs on that
document and close it when you are done.

I hope this helps,
cj

> All,
>
[quoted text clipped - 18 lines]
>
> Gavin.
Gavin - 09 Mar 2004 15:36 GMT
Thanks a lot for your help. I did the save as and it worked fine.

> Hi,
>
[quoted text clipped - 27 lines]
> >
> > Gavin.
 
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.