Hello Everyone. I have been using this code for years with no problem and now when I open a word document from Access, I get all the revisions. So, I found these settings called acvtivewindow. It works the very first time through. However, after that, you get the error that is in my title every time. Here is my Code:
Public Sub open_Word_Doc(strDocName As String)
' Created by Chuck Anderson Info Systems Dept - 12/07/2006
' Remarks>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Module will build the path and name of a file based upon the Appeal Number
' and then open a Word Document
Dim MS_Word As Object
Dim strPath As String
Dim strMessage As String
'Define the path of the document
strPath = "\\SolidVM\data\Pres\POOL\IEB_Decisions\" & strDocName & ".doc"
' Check to see if the file exists
If Dir(strPath) <> "" Then
Set msword = CreateObject(Class:="Word.Application") 'Create an instance of MS Word
msword.Visible = True
msword.Documents.Open strPath 'Open the Document
ActiveWindow.View.RevisionsView = wdRevisionsViewFinal
ActiveWindow.View.ShowRevisionsAndComments = False
Else
strPath = "\\SolidVM\data\Pres\POOL\IEB_Decisions\" & strDocName & ".docx" ' See if it is an Office 2007 or > file
If Dir(strPath) <> "" Then
Set msword = CreateObject(Class:="Word.Application") 'Create an instance of MS Word
msword.Visible = True
msword.Documents.Open strPath 'Open the Document
ActiveWindow.View.RevisionsView = wdRevisionsViewFinal
ActiveWindow.View.ShowRevisionsAndComments = False
Else
strMessage = Trim("File " & strDocName & ".doc" & " does not exist")
MsgBox (strMessage)
End If
End If
End Sub
Any idea's on how to fix this issue? I have tried running the database from the server folder where the documents exist, but it still behaves the same way.
Public Sub open_Word_Doc(strDocName As String)
' Created by Chuck Anderson Info Systems Dept - 12/07/2006
' Remarks>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' Module will build the path and name of a file based upon the Appeal Number
' and then open a Word Document
Dim MS_Word As Object
Dim strPath As String
Dim strMessage As String
'Define the path of the document
strPath = "\\SolidVM\data\Pres\POOL\IEB_Decisions\" & strDocName & ".doc"
' Check to see if the file exists
If Dir(strPath) <> "" Then
Set msword = CreateObject(Class:="Word.Application") 'Create an instance of MS Word
msword.Visible = True
msword.Documents.Open strPath 'Open the Document
ActiveWindow.View.RevisionsView = wdRevisionsViewFinal
ActiveWindow.View.ShowRevisionsAndComments = False
Else
strPath = "\\SolidVM\data\Pres\POOL\IEB_Decisions\" & strDocName & ".docx" ' See if it is an Office 2007 or > file
If Dir(strPath) <> "" Then
Set msword = CreateObject(Class:="Word.Application") 'Create an instance of MS Word
msword.Visible = True
msword.Documents.Open strPath 'Open the Document
ActiveWindow.View.RevisionsView = wdRevisionsViewFinal
ActiveWindow.View.ShowRevisionsAndComments = False
Else
strMessage = Trim("File " & strDocName & ".doc" & " does not exist")
MsgBox (strMessage)
End If
End If
End Sub
Any idea's on how to fix this issue? I have tried running the database from the server folder where the documents exist, but it still behaves the same way.