Re: OFFICE AUTOMATION!!!!
First of all, the speed of the PC it runs on has got nothing to do with it. I think you need to look further. Normally, the objDocument must be set, otherwise the error should have happened on the previous line. So I think you must look at the VBProject. Since every word document has one, this shouldn't be the problem. Then we arrive at VBComponents("ThisDocument"), my guess is that the problem is here. I think you might just have encountered a file that doesn't a component called ThisDocument, which is the default. Probably, this has been renamed for one reason or another. Add some errorhandling to the program, which will show you to filename you are currently working on (if you don't display it anywhere). Then open that file in Word, and open the VB Editor. See if there is an object called ThisDocument.
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook