Agree with the other poster that it shouldn't take so long. I've done a lot
of work with VB and Word; speed has never been an issue. Are you using
exclusively Range objects and working with the Word app invisible? (as
opposed to using the Selection object and Word visible, which can be slow
because Word does all that background repagination)
But in any case, why not just get Word to save the document as a text file?
Or, rather than looping through your paragraphs use something like:
Open MyFile.txt For Output as #Filenum
Print #FileNum, MyDoc.MainStory.Text
Close #FileNum
Dan said:
I have programmed what I need to do with reading Word documents using
Word.Application in VB. The problem is that it is extremely slow. My program
is simply looping through the paragraphs in the main story in a sample Word
document and writing them to a text file. I am running Windows XP
Professional on a 2.2 GHz Dell system with Word 2000. My test file is 77 KB,
of which the main story object is about half of the file size. It takes 9
minutes to loop through the 262 paragraphs and output them to a text file.
Am I doing something wrong that it should take so long?
To put it in perspective, my program also includes the capability to
convert WordPerfect documents. If this were a WordPerfect file, this same
conversion to a text file would take 10-20 seconds at the most.