?
Solved

Word object acting very slowly

Posted on 2005-03-08
5
Medium Priority
?
238 Views
Last Modified: 2010-05-02
I have this problem: I use a Word object, created by CreateObject("Word.Application"), in a VB6 application. All the commands I send to Word using this object, no matter the command, even parameter change ( like refWord.Selection.Find.Wrap = 1  ), are very slow, around 3 commands by second.

The problem appends on Word 2000 only, and only on half my test computers, no matter the Word patch installed.

I have the same problem with a Foxpro application.

My application send thousands commands to Word, it can up to fifteen minutes to execute a task.
0
Comment
Question by:ayottea
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:Smallint
ID: 13494959
Only way to speed up Word automation is to use early binding.

I mean:

Use

Dim oApp as Word.Application
Set oApp = new Word.Application

Instead of

Dim oApp as Object
Set oApp = CreateObject("Word.Application")

You must do it for all of your Word Objects in your project.

Anyway automation is not known by its performance, but using early binding you can expect to be twice faster than using late binding.

Take a look here...

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q245115


Cheers


Cheers
0
 
LVL 1

Author Comment

by:ayottea
ID: 13496116
It doesn't work.
I included the object library of Word 2000 and used oApp = new Word.Application, and it's still slow.

Remember, I don't have any speed problem with other versions of Word, and I got this on only half my test computers, no matter the operating system, or the patch installed.
0
 
LVL 7

Accepted Solution

by:
Smallint earned 1000 total points
ID: 13500892
Your problem sounds very strange, and if you are sure all machines are on same patch level, then I'm wondering if may be problem is something external to VB. Have you seen something strange in Task Manager, any process near 100%? Any common program on slow machines? Have you tried to reinstall Office?
0
 
LVL 1

Author Comment

by:ayottea
ID: 13574284
I got a clue, the problem doesn't appends on Windows 2000, only on Windows XP, but, not on all computer with Windows XP. There is a third clue I must find, and I can't.

I tried to reinstall Office, I tried to ally updates for Office and Windows one by one, I still can't find what is the third clue.
0
 
LVL 1

Author Comment

by:ayottea
ID: 13771974
Finally, it was a bug in Office 2000 . Yesterday's patch is the solution.

Thanks for your support.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

601 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