Pushing Word to limits in vb.net

E

Eryk

Hello all,

I'm currently developing an application that uses Word 2003. The goal is
to move through each page in a document and add page specific information. I
use loop with:
Dim workPageRegion As Word.Range =
document.Range.GoTo(What:=Word.WdGoToItem.wdGoToPage,
Which:=Word.WdGoToDirection.wdGoToAbsolute, Count:=pageNumber)
workPageRegion.Select()

and add textbox with some info. Its ok with few pages but when the document
is arround 500-1000 pages at some (random) page I get errror code -2147418111
(app bussy :) so for my non profi eye looks like word is so busy with
previous opperations that it does not want any more.
When I used the same code in VBA it works great, and whats more its 2x
faster.
so my question is, how can i ensure that my code will work, and how can i do
it fast ?

I use VB.NET (app that creates its own word instance and tells word what to
do :) )

Thanks in advance for any help
 
E

Eryk

another question:

how can i obtain the same performance in vb.net connected to word as I can
obtain with macro in vba ??

???
 

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