I have a command button on a form that I need to OPEN a specific MS WORD document when CLICKed. Can someone help me with the VB code to initiate this action. Right now the button will open MS Word – but it only opens the application and does not open a specific file.
File name = U:/ThankYouLtr
Command Button = Word_Doc
Current Code =
Private Sub WORD_DOC_Click()
On Error GoTo Err_WORD_DOC_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_WORD_DOC_Click:
Exit Sub
Err_WORD_DOC_Click:
MsgBox Err.Description
Resume Exit_WORD_DOC_Click
End Sub
File name = U:/ThankYouLtr
Command Button = Word_Doc
Current Code =
Private Sub WORD_DOC_Click()
On Error GoTo Err_WORD_DOC_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_WORD_DOC_Click:
Exit Sub
Err_WORD_DOC_Click:
MsgBox Err.Description
Resume Exit_WORD_DOC_Click
End Sub