Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Vincent[_3_] Vincent[_3_] is offline
external usenet poster
 
Posts: 1
Default MailMerge from VBA

Hello,

My program is performing a mailmerge from within Microsoft Access
using VBA. The call to perform the actual merge is as follows:

wordApp.Documents(wordApp.ActiveDocument.Name).Mai lMerge.Execute false

The problem I am having is that the parameter sent to the execute call
(false), does not seem to be working in accordance with Microsoft's
documentation. If a merge field is missing from the document, the
document pauses and displays the error. According to the
documentation, if you set false as the value for the "pause"
parameter, then this should not happen--errors should be reported by
Word in a new document. I am using Microsoft Word 2007. Does anyone
know why Word is behaving like this and how to prevent it? Thanks.

Vincent
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default MailMerge from VBA

Unfortnately the documentation makes a general statement about mailmerge
errors, whereas in fact /some/ types of error are reported in dialog
boxes regardless of this setting, including the type you mention. (In
that case, the error is also written to the error document when
Pause:=False).

for example, if you have a field with a syntax error such as

{ =1,1 }

then no dialog box appears and the error is written to the error
document as expected.

This is (presumably) why so many people need code that will help them
locate /every/ Merge field in a document - i.e. so they can remove or
fix the invalid ones pre-merge.

I don't think setting DisplayAlerts to wdAlertsNone makes any difference
in this case.

Peter Jamieson

http://tips.pjmsn.me.uk

Vincent wrote:
Hello,

My program is performing a mailmerge from within Microsoft Access
using VBA. The call to perform the actual merge is as follows:

wordApp.Documents(wordApp.ActiveDocument.Name).Mai lMerge.Execute false

The problem I am having is that the parameter sent to the execute call
(false), does not seem to be working in accordance with Microsoft's
documentation. If a merge field is missing from the document, the
document pauses and displays the error. According to the
documentation, if you set false as the value for the "pause"
parameter, then this should not happen--errors should be reported by
Word in a new document. I am using Microsoft Word 2007. Does anyone
know why Word is behaving like this and how to prevent it? Thanks.

Vincent

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mailmerge Sriniwas Mailmerge 2 October 7th 08 11:29 AM
mailmerge judgjohn Mailmerge 1 July 30th 08 11:43 AM
MailMerge Help ChrisLouie Microsoft Word Help 2 August 13th 07 09:42 PM
help with mailmerge please steve goodrich Mailmerge 3 March 6th 06 04:32 PM
MAILMERGE COOKIE Mailmerge 1 August 4th 05 10:08 PM


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

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"