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

Tip: Looking for answers? Try searching our database.

Trap Errors in VB.NET Mail Merge Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin G. - 17 Oct 2003 16:31 GMT
I have a VB.NET Service Program that performs a Mail Merge
with template documents and the merge data. When a merge
field is present in the Template Document but not present
in the header fields I receive the "Invalid Merge Field"
Error (Dialog Box). How can I trap this error in code
using the World Mail Merge Object Model?
Kevin McBride - 21 Oct 2003 12:16 GMT
To be honest, I don't know for sure that you can't dismiss the message with
the ole server, however, I found the a post in MSDN, PSS 307292, which
references using a timer to detect when Word has stopped responding.

It's not the most graceful way to handle it, but it also takes care of other
error messages and problems that may occur while working with Word.

HTH

> I have a VB.NET Service Program that performs a Mail Merge
> with template documents and the merge data. When a merge
> field is present in the Template Document but not present
> in the header fields I receive the "Invalid Merge Field"
> Error (Dialog Box). How can I trap this error in code
> using the World Mail Merge Object Model?
Peter Jamieson - 24 Oct 2003 21:31 GMT
Generally speaking the most you can do to prevent alerts is set

Application.DisplayAlerts = wdAlertsNone

but it may not help in the specific case being discussed. AFAIK this sort of
behaviour has long been a problem with Word whatever development environment
you are using and your suggestion is probably the only approach likely to
work.

--
Peter Jamieson
MS Word MVP

> To be honest, I don't know for sure that you can't dismiss the message with
> the ole server, however, I found the a post in MSDN, PSS 307292, which
[quoted text clipped - 11 lines]
> > Error (Dialog Box). How can I trap this error in code
> > using the World Mail Merge Object Model?
 
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.