I am making an excel project to manage the creation and filing of a set of word documents created from the same .dotx template. I dont have experience with vba for MS Word. The requisit MS References are open to use the Word Object model.
Before moving or copying a word document using scripting.FileSystemObject, I wish to identify if the file in question is OPEN, and close it before move/copy.
I thought that one documents collection would cover all open Word application windows, and that this code would report all open docs:
Dim aDoc As Word.Document
Dim aName As String
aName = ""
For Each aDoc In Word.Documents
aName = aName & aDoc.Name & vbCr
However, when I open two docs in separate windows, sometimes one is reported (twice), and sometimes both reported. Changing which windows file has most recently been 'on top' made no difference.
Please can you help?