A solution to Word automation running slow

Hi All,

Various times over the years I’ve written routines in Lotusscript to automate the creation of letters in Word, using data retrieved from Notes databases. I’ve always been quite frustrated with how slow it runs. I was doing some testing yesterday on a run of 150 letters and found it was taking 332 seconds to run. It was fine to start with, but once it got to 17 letters or so, it would slow right down. However, I found that when I made the application visible, it sped up to 102 seconds to create the 150 letters. Unfortunately, it looks rubbish when you run it visibly, and the user can cause all sorts of problems if they press buttons or click on anything while it is running. This also seemed bizarre because all of the pages I found on the internet said that to speed up your Word automation, you should always keep the application invisible.

Anyway, I tried turning off all the horrible auto-correct and auto-format options which Word switches on by default, but none of it seemed to help. Until, that is, I found the auto-pagination feature and switched that off. My script now produces the 150 letters in the background in around 45 seconds! (Out of interest, if i make Word visible during the run, it now takes just under 100 seconds)

So, if anyone out there is having problems with Word automation being slow from Lotusscript, try adding this just after you create your Word application object:

wordApplicationObject.Options.Pagination = False

Emily.

Subject: *Thanks! These are the sorts of tips that make this database such a wonderful, searchable resource.

Subject: RE: *Thanks! These are the sorts of tips that make this database such a wonderful, searchable resource.

Thank you for taking the time to share this tip,

JYR

Subject: A solution to Word automation running slow

Great tip, thanks.