D
Dave Neve
Hi
I'm embarrased to ask so many questions on one stupid macro but.....
The following code doesn't work when inserterd into 'this document' of a
project where the userform also exists.
Sub AutoOpen()
Dim Myform
If ActiveDocument.Name = "Mydoc.doc" Then
Myform.Show
End If
End Sub
The error is 'object required' which I find strange as the Userform is in
the same Project
However, when inserted into the code of the object itself (the userform), it
works.
The title of my window is Microsoft Visual Basic-Mydoc[ThisDocument (Code)]
so I think it's natural to assume that 'Mydoc' ='This document' and that
therefore the code should work when inserted into ThisDocument.
So the question is 'What is the relationship between 'XXX.doc' (the open
..doc) and 'This
document' in VBA
Thanks in advance again.
I'm embarrased to ask so many questions on one stupid macro but.....
The following code doesn't work when inserterd into 'this document' of a
project where the userform also exists.
Sub AutoOpen()
Dim Myform
If ActiveDocument.Name = "Mydoc.doc" Then
Myform.Show
End If
End Sub
The error is 'object required' which I find strange as the Userform is in
the same Project
However, when inserted into the code of the object itself (the userform), it
works.
The title of my window is Microsoft Visual Basic-Mydoc[ThisDocument (Code)]
so I think it's natural to assume that 'Mydoc' ='This document' and that
therefore the code should work when inserted into ThisDocument.
So the question is 'What is the relationship between 'XXX.doc' (the open
..doc) and 'This
document' in VBA
Thanks in advance again.