Disable User Interaction in Word When Invoked from Scripts

M

microsoft

Is there a way to stop word from showing interactive dialog boxes when
invoked from a VBScript, VB program or others using the CreateObject()?

Openning a dialog box when run from a program causes the program to hang and
there is no way of detecting this condition to responding to it.

Thanks
Jeff
 
B

Bob G.

Jeff,

Word, like all other Office apps, is designed to interact
with the end user so it's very difficult to get around
the situation you want to avoid. Here's a knowledge base
article you might fight extremely useful....

PSS ID Number: 257757

Article Last Modified on 10/17/2002

This article was previously published under Q257757

SUMMARY
Developers can use Automation to Microsoft Office to
build custom solutions that utilize the capabilities and
features that are built into the Office product. While
such programmatic development can be implemented on a
client system with relative ease, there are a number of
complications that can occur if Automation is to take
place from server-side code such as Active Server Pages
(ASP), DCOM, or an NT Service.

This article discusses the complications that developers
may face, offers alternatives to Automation that can
speed performance, and suggests ways to configure Office
if server-side Automation is unavoidable. Developers
should be aware, however, that the suggestions provided
below are for informational purposes only. Microsoft does
not recommend or support server-side Automation of Office.

NOTE: In this context, the term "server-side" also
applies to code that is running on a Microsoft Windows NT
or Microsoft Windows 2000 workstation, provided that it
is running from a WinStation other than the interactive
station of the user that is logged on. For example, code
that is started by Task Scheduler under the SYSTEM
account runs in the same environment as "server-side" ASP
or DCOM code, and therefore experiences many of the same
issues. For more information on WinStations and COM, see
the "More Information" and "References" sections.
 
B

Bob G.

Jeff,

Just to highlight one point in the article I suggested,
under "Problems Using Automation of Office Server-Side"
there appears

Interactivity with the Desktop: Office Applications
assume that they are being run under an interactive
desktop, and may in some circumstances need to be made
visible for certain Automation functions to work
properly. If an unexpected error occurs, or an
unspecified parameter is needed to complete a function,
Office is designed to prompt the user with a modal dialog
box that asks the user what they want to do. A modal
dialog box on a non-interactive desktop cannot be
dismissed, which causes that thread to stop responding
(hang) indefinitely. Although certain coding practices
can help reduce the likelihood of this occurring, they
cannot prevent it entirely. This fact alone makes running
Office Applications from a server-side environment risky
and unsupported.
 
B

Bob G.

Jeff,

In case you don't have a chance to read the entire
article I suggested here is a point I think you'll find
useful:

Problems Using Automation of Office Server-Side

INTERACTIVITY WITH THE DESKTOP: Office Applications
assume that they are being run under an interactive
desktop, and may in some circumstances need to be made
visible for certain Automation functions to work
properly. If an unexpected error occurs, or an
unspecified parameter is needed to complete a function,
Office is designed to prompt the user with a modal dialog
box that asks the user what they want to do. A modal
dialog box on a non-interactive desktop cannot be
dismissed, which causes that thread to stop responding
(hang) indefinitely. Although certain coding practices
can help reduce the likelihood of this occurring, they
cannot prevent it entirely. This fact alone makes running
Office Applications from a server-side environment risky
and unsupported.
 
C

Cindy Meister -WordMVP-

Hi Microsoft,
Is there a way to stop word from showing interactive dialog boxes when
invoked from a VBScript, VB program or others using the CreateObject()?
No, there's not. That's one reason Office products aren't recommended to
be run on servers.

INFO: Considerations for Server-Side Automation of Office [Q257757]
http://support.microsoft.com?kbid=257757

Best you can possibly to is set DisplayAlerts to none. But that won't
suppress all possible messages Word could show.

There is a kludge-workaround that you can use to get rid of a dialog box
if the app appears to "hang" for a given amount of time. See

Q259971 HOWTO: Dismiss a Dialog Box Displayed by an Office Application
with
http://support.microsoft.com?kbid=259971

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top