What is the difference between a Document and a Window in Word Automation
Posted on 2011-03-23
I have some Word automation code that operates fine with Office 2003.
When we run the code on a machine with Office 2010, it fails.
The code seems to not differentiate between Windows and Documents - it refers to:
WordApp.Windows(myDoc) and WordApp.Documents(myDoc)
This seems fine for Office 2003. For Office 2010, we get errors saying the items in the Windows collection don't exist.
Can anyone clarify the difference in the two collections and why these errors might appear now?
It is also possible that the differences relate to whether the document is being opened with a template, but this is not conclusive at this point.
Any help is much appreciated.