I'm almost where I need to be. I can get my code to check to see if a file exists, display an error message if it doesn't, or open the file in Word if it does. Unfortunately, the focus does not change to Word at that point with a maximized window. What code do I need to add to do that? Here is what I have so far:
Private Sub View_manual_button_Click()
Dim filepath As String
filepath = CurrentProject.Path & "\Instructions_for_CAFP_Inventory_Program.doc"
'MsgBox CurrentProject.Path 'MsgBox for debugging
If Len(Dir(CurrentProject.Path & "\Instructions_for_CAFP_Inventory_Program.doc" )) = 0 Then
MsgBox "File does not exist. "
Else
Dim oApp As Object
Dim oWord As Object
Set oApp = CreateObject("Word.Application")
Set oWord = oApp.Documents.Open(FileName:=filepath)
oApp.Visible = True
'Dim oApp As Object
'Set oApp = CreateObject("Word.Application")
'oApp.Visible = True
End If
On Error GoTo Err_View_manual_button_Click
Exit_View_manual_button_Click:
Exit Sub
Err_View_manual_button_Click:
MsgBox Err.Description
Resume Exit_View_manual_button_Click
End Sub