A
Alex
I'm trying to use the word document as a help file.
Before to open it, I'm checking whether it's already
opened. The checking is going fine. But, after that I get
an error message: "Object variable or With block variable
not set."
Dim MyWord As Object
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim strFileName As String, logFileIsOpened As Boolean
strFileName = "FileName"
logFileIsOpened = FileLocked(strFileName)
If logFileIsOpened = True Then
Set wrdDoc = wrdApp.Documents.Open(strFileName) ' Here
is the error !!!!!!!!!!!!!!!!!!!!!!!!!!!!
wrdDoc.Activate
Else
Set MyWord = GetObject(strFileName)
MyWord.Application.Visible = True
End If
Could anybody clarify it?
Thanks
Before to open it, I'm checking whether it's already
opened. The checking is going fine. But, after that I get
an error message: "Object variable or With block variable
not set."
Dim MyWord As Object
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim strFileName As String, logFileIsOpened As Boolean
strFileName = "FileName"
logFileIsOpened = FileLocked(strFileName)
If logFileIsOpened = True Then
Set wrdDoc = wrdApp.Documents.Open(strFileName) ' Here
is the error !!!!!!!!!!!!!!!!!!!!!!!!!!!!
wrdDoc.Activate
Else
Set MyWord = GetObject(strFileName)
MyWord.Application.Visible = True
End If
Could anybody clarify it?
Thanks