C
C_P
Hello,
Currently, I am working on a document that analyzes other documents.
Basically, the user clicks on a button and a dialog box opens up to
browse to a file and the analyzation begins.
It can bring up the dialog box correctly and minimize the current
window of the original document, but when I try to bring the document
to be analyzed into focus, it gives the error:
'Runtime error 5941':
The requested member of the collection does not exist.
Here is the code:
With Dialogs(wdDialogFileOpen)
.Display
DocToAnalyze = WordBasic.FilenameInfo$(.Name, 2)
End With
'On Error GoTo ErrorHandler
'Windows(analyzedoc).WindowState = wdWindowStateMinimize
Windows(DocToAnalyze).Activate
I have commented everything out around the last line and targeted it as
the source of the error, but I am not for sure why. I have tried
putting in other documents open such as "Document4.doc" and "Document4"
but to no avail.
Thank you for any help.
Currently, I am working on a document that analyzes other documents.
Basically, the user clicks on a button and a dialog box opens up to
browse to a file and the analyzation begins.
It can bring up the dialog box correctly and minimize the current
window of the original document, but when I try to bring the document
to be analyzed into focus, it gives the error:
'Runtime error 5941':
The requested member of the collection does not exist.
Here is the code:
With Dialogs(wdDialogFileOpen)
.Display
DocToAnalyze = WordBasic.FilenameInfo$(.Name, 2)
End With
'On Error GoTo ErrorHandler
'Windows(analyzedoc).WindowState = wdWindowStateMinimize
Windows(DocToAnalyze).Activate
I have commented everything out around the last line and targeted it as
the source of the error, but I am not for sure why. I have tried
putting in other documents open such as "Document4.doc" and "Document4"
but to no avail.
Thank you for any help.