Solved

Handle Word Input Dialogue box by Application

Posted on 2011-03-16
14
788 Views
Last Modified: 2012-05-11
Hi,

I am working on an application which has automation with Microsoft Word. The issue is with the user input dialogue box which appears in document while processing and that interrupts the process and wait for the user input.  

For Example:
While opening a doc file from application for process, a dialogue box appears from MS Word for input. Please see the attached image file for dialogue box type.


Our requirement is to handle these such type of dialogue boxes which comes from MS Word from my application.


Thanks
Image.jpg
0
Comment
Question by:OTSSolutions
  • 7
  • 7
14 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 35154404
Try this to deactivate word dialogs and confirmations...

WordApplication.DisplayAlerts:=0;
0
 
LVL 19

Expert Comment

by:Thommy
ID: 35154409
Also possible...

WordApplication.DisplayAlerts:=false;
0
 

Author Comment

by:OTSSolutions
ID: 35163813
This is my code

WordApp.DisplayAlerts := wdAlertsNone;
WordApp.ScreenUpdating := False;
bConfConversions := False;
WPOpen( bMakeVisible );
WordApp.Documents.Open( sWPDoc, bConfConversions, bReadOnly, EmptyParam, EmptyParam,
        EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam   );
WordDoc.ConnectTo( WordApp.ActiveDocument );

But unable to skip those dialogue boxes.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 19

Expert Comment

by:Thommy
ID: 35164028
The "Show Repairs" dialog only appears, if you are opening a damaged word doc.

Therefore it is no possible to prevent this dialog from appearing...

You cannot prevent the "Show Repairs" dialog box from appearing when you open a damaged document
http://support.microsoft.com/kb/903740

The only way to get rid of that dialog is to make sure that your word docs are accurate and do not need any repairs...
0
 

Author Comment

by:OTSSolutions
ID: 35164570

Hi Expert,

I do agree with you but that was an example. The problem is to getting lots more dialogue boxes from Word application whether some of are with the damaged document and some of are coming while converting those document into other format.

I will upload if any such document will found.
Thanks
0
 
LVL 19

Expert Comment

by:Thommy
ID: 35164617
Ok, please upload demo docs...
0
 

Author Comment

by:OTSSolutions
ID: 35164698

I can not upload complete document here please take a look in image.

Thanks


Image2.jpg
0
 

Author Comment

by:OTSSolutions
ID: 35164762

Mote Examples:
 Example 3 Example 4 Example 5
0
 
LVL 19

Expert Comment

by:Thommy
ID: 35165697
Please tell me your MS Office version...
0
 

Author Comment

by:OTSSolutions
ID: 35178415

MS Office 2007 & 2010.
0
 

Author Comment

by:OTSSolutions
ID: 35230297
Hi,

I am still waiting for the solutions, Please...
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 35230476
Please check this basic article for possible solutions...

How To Dismiss a Dialog Box Displayed by an Office Application with Visual Basic
http://support.microsoft.com/kb/259971
0
 
LVL 19

Expert Comment

by:Thommy
ID: 35230526
What's the value of your variable bReadOnly???

bReadOnly should be true to avoid "File in Use" message (image3.jpg)...
0
 

Author Closing Comment

by:OTSSolutions
ID: 35322285
Hello Expert,

I am giving you complete points due to the solution is not possible in easy way. Your suggested article says like this.

Even if you use these techniques and carefully design your application to avoid dialog boxes, you may still be faced with a situation where a dialog box cannot be avoided with the methods and properties exposed in the Office application's object model. In such situations, it might be necessary to programmatically dismiss a dialog box by simulating user input. The following demonstration illustrates how this can be accomplished with a Visual Basic Automation client.


So finally, I don't think we have too much control on to dismiss such types of dialog box. I have to resolve this issue by programmatically.

Thanks!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now