S
Shipp
I have the following code in a module. When I execute the
code Word is loaded and is visible. However, the document
that is declared in strDOC does not load up automatically.
Any help would be appreciated.
Private Sub btnWord_Click()
On Error GoTo Err_btnWord_Click
Dim strDir As String
Dim strDoc As String
Dim strTyp As String
Dim strFul As String
Dim objWord As Word.Document
strDir = Forms!frmConHdr!sfrmDocuments.Form.Directory
strDoc = Forms!frmConHdr!sfrmDocuments.Form.FileName
strTyp = Forms!frmConHdr!sfrmDocuments.Form.cboType
strFul = strDir & strDoc & "." & strTyp
Set objWord = GetObject(strFul)
objWord.Application.Visible = True
Exit_btnWord_Click:
Exit Sub
Err_btnWord_Click:
MsgBox Err.Description
Resume Exit_btnWord_Click
End Sub
code Word is loaded and is visible. However, the document
that is declared in strDOC does not load up automatically.
Any help would be appreciated.
Private Sub btnWord_Click()
On Error GoTo Err_btnWord_Click
Dim strDir As String
Dim strDoc As String
Dim strTyp As String
Dim strFul As String
Dim objWord As Word.Document
strDir = Forms!frmConHdr!sfrmDocuments.Form.Directory
strDoc = Forms!frmConHdr!sfrmDocuments.Form.FileName
strTyp = Forms!frmConHdr!sfrmDocuments.Form.cboType
strFul = strDir & strDoc & "." & strTyp
Set objWord = GetObject(strFul)
objWord.Application.Visible = True
Exit_btnWord_Click:
Exit Sub
Err_btnWord_Click:
MsgBox Err.Description
Resume Exit_btnWord_Click
End Sub