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 / April 2005

Tip: Looking for answers? Try searching our database.

IncludeText and Emails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary - 06 Apr 2005 19:57 GMT
Hi,

I have a VB program that we use to send emails to customers. We use a
letter_name field in the database which is used in a IncludeText field to
get the appropriate letter. I need to be able to trap the "Error! Not a
valid filename." error and stop the merge if the IncludeText field can not
find the filename. Any suggestions?

Thanks

Gary
Peter Jamieson - 07 Apr 2005 11:31 GMT
Assuming you are using Word 2002 or later, you will probably need to use
Word's MailMerge events, specifically the MailMergeBeforeRecordMerge event,
to inspect the value of the field before merging it.

The only other suggestion I can make is that your VB program could do a
preliminary pass through the data to construct and validate all the file
names before actually starting the merge.

Peter Jamieson

> Hi,
>
[quoted text clipped - 7 lines]
>
> Gary
Gary - 12 Apr 2005 01:01 GMT
Thanks Peter,

I guess the best thing to do would be to use the VB to do a preliminary
pass on the data to verify if the files exists.  I'm not sure if the
MailMergeBeforeRecordMerge event could be use to abort the merge, since it
only occurs after the MailMerge.execute has already been issued.

Gary
Peter Jamieson - 12 Apr 2005 10:04 GMT
> I guess the best thing to do would be to use the VB to do a preliminary
> pass on the data to verify if the files exists.

It's the approach I'd probably take.

> I'm not sure if the
> MailMergeBeforeRecordMerge event could be use to abort the merge,

Yes,probably best avoided, but it depends partly on whether you wanted to
try to cancel all the e-mails you had already merged (in which case you're
too late if you use this approach) or simply stop merging when you encounter
a missing file, in which case what you need to do is set a variable that you
test at the beginning of the MailMergeBeforeRecordMerge to cancel the merge
for that record, and as necessary at the beginning of
MailMergeAfterRecordMerge and MailMergeAfterMerge. There may be a better way
but that one has worked for me.

Peter Jamieson.

> Thanks Peter,
>
[quoted text clipped - 4 lines]
>
> Gary
 
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.