Set_visible causing major slow down

K

kalukaley

We're using automation to create MS Word documents. Borland C++ builder (I
am in the process of converting the code for use in Visual Studio) is what
we're using.

We just started encountering the following intermittent problem.

When the application object calls set_visible the application appears to
hang. Turns out that it's not. If you wait about 15 minutes (that's not an
exaggeration) word will finally open a document and go on to run the rest of
the code to completion.

The com object targets word 2000. the version of word we're running is
2002, and the environment is Citrix (Windows server 2003).
 
J

Jean-Guy Marcil

kalukaley said:
We're using automation to create MS Word documents. Borland C++ builder (I
am in the process of converting the code for use in Visual Studio) is what
we're using.

We just started encountering the following intermittent problem.

When the application object calls set_visible the application appears to
hang. Turns out that it's not. If you wait about 15 minutes (that's not an
exaggeration) word will finally open a document and go on to run the rest of
the code to completion.

The com object targets word 2000. the version of word we're running is
2002, and the environment is Citrix (Windows server 2003).

Citrix always slows things down as the application is shared, not actually
on the local machine.
If you are targeting Word 2000, why are you running Word 2002?
If setting to visible slows things down to a screeching halt, and since you
are automating a process, why don't you just let the application run
invisible?
 
K

kalukaley

Thank you for your response.

We're actually targeting Winword 2002. Unfortunately, this is the
environment I am stuck with until we upgrade to Office 2007 in about a year.
At that point I will be using all the nice utilities available to me in
Visual Studio.

The Borland Product being used here is using the Win2k object.
Documentation is sparse at best on how to use these objects, and no one here
seems to know how to target win_xp using the borland objects.

It looks like I may have to just build the solution myself using Visual
Studio and COM. VSTO targets 2003 and above. I'll have to blow the dust
off of my COM books.

One thing I will try is your suggestion of not calling set_visible. I've
never felt comfortable with the Window being open to users while we were
still processing data.

Let's see what happens.
 
J

Jean-Guy Marcil

kalukaley said:
Thank you for your response.

One thing I will try is your suggestion of not calling set_visible. I've
never felt comfortable with the Window being open to users while we were
still processing data.

If you can stay away from the Selection object and work exclusively with
Range objects, you do not need the document to be visible. Some of the
properties/methods applied to the Selection object will not work with a
document that is not visible.
 
K

kalukaley

I tried your suggestions. They did not work. However, I just received some
more information on the problem that I think goes beyond this Forum.

DETAILS:
=====
I was informed that when this slow down is happening our users cannot use
Internet explorer because it appears to hang as well.

It appears that this problem is falls outside of the subject matter of this
forum.

Thank you for your responses. They were informative and gave me new insight
into the application.
 

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