Re: How to suppress Word dialogs during merge

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Charles Kenyon (msnewsgroup_at_remove.no.spam.addbalance.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 10:34:48 -0600

I haven't analyzed your code. I doubt I'm competent to debug it. However,
have you looked at
http://www.mvps.org/word/FAQs/MailMerge/MergeStraightToPrintrWVBA.htm.

-- 
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of 
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://www.mvps.org/word which is awesome!
 --------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Ron Ford" <anonymous@discussions.microsoft.com> wrote in message 
news:12a701c4ee8c$577d5440$a501280a@phx.gbl...
>I am trying to send a merge document to the printer from
> the command line and would like to suppress (or
> automatically answer) Word dialog questions so the entire
> process can occur without user intervention.  The
> datasource, test.txt, contains a single record.
> Using Word 2002 on XP Professional.
>
> My command line is:
>     \(path_to_word)\winword  docfile.dot  /mMyMerge
>
> the Word macro is:
>
> Sub MyMerge()
>  With Active.Document.MailMerge
>    .Destination = wdSendToPrinter
>    .SuppressBlankLines = True
>    With .DataSource
>      .FirstRecord =
> ActiveDocument.MailMerge.DataSource.ActiveRecord
>      .LastRecord =
> ActiveDocument.MailMerge.DataSource.ActiveRecord
>    End With
>    .Execute Pause:=False
>    SendKeys "%N" 'To answer the 'Save' document question.
>    End With
>    ActiveDocument.Close
>    Application.Quit
>  End With
> End Sub
>
> The SendKeys successfully prevents the save document
> dialog from appearing, but I haven't been able to prevent
> an earlier dialog which states:
>
> Opening this document will run the following SQL command:
>   SELECT * FROM c:\testdir\test.txt
> Data from your database will be placed in the document.
> Do you want to continue?
>    Yes  No
>
> Since I always want the Yes option, I've tried adding
> SendKeys "%Y" to every line in the macro without effect.
>
> Is there another method of suppressing this dialog?
> Many thanks.
>
>
>
>
> 


Relevant Pages

  • How to suppress Word dialogs during merge
    ... the command line and would like to suppress (or ... the Word macro is: ... Sub MyMerge() ...
    (microsoft.public.word.mailmerge.fields)
  • Re: how to write sysrexx
    ... I now have a sysrexx question.... ... How do suppress the '/DI,L=Z' output after you issue the command. ... I used to work a lot of Netview and rexx inside Netview and we had IBM ... We use question mark as the command character for secondary JES2 ...
    (bit.listserv.ibm-main)
  • Re: Executing secondary command in shell.run
    ... The second command with double double quotation marks definitely affects the first commands here. ... Which wrongly suppress the "AAA " part. ...
    (microsoft.public.scripting.vbscript)
  • Suppressing PER messages
    ... Is there a way to suppress the message 'Command Complete' issued by a PER CMD? ... Issue 'PER DIAG 58 PRINTER CMD DUMP 0.20;BASE3' ...
    (bit.listserv.ibm-main)
  • Re: no page number command
    ... Word New User FAQ & Web Directory: http://addbalance.com/word ... Microsoft's Legal Users' Guide) http://addbalance.com/usersguide ... This message is posted to a newsgroup. ... > this command and make it, again, workable. ...
    (microsoft.public.word.numbering)