Hi All,
I've been searching for a solution for this and I think I'm half way there.
In one of my workbookss (tab called "Dashboard") I have a command button that opens a specific word document. This word document is a Mail Merge form that is linked to another tab in the same workbook called "Data". The code I found online opens the correct word document, however it doesn't offer me the message that pops up that says "Opening this document will run the following SQL command: SELECT * FROM 'Data$'..." as it does when I open it manually.
Is there a way to edit the code so it gives me this option when I click the command button?
Thanks in advance for any suggestions/fixes
I've been searching for a solution for this and I think I'm half way there.
In one of my workbookss (tab called "Dashboard") I have a command button that opens a specific word document. This word document is a Mail Merge form that is linked to another tab in the same workbook called "Data". The code I found online opens the correct word document, however it doesn't offer me the message that pops up that says "Opening this document will run the following SQL command: SELECT * FROM 'Data$'..." as it does when I open it manually.
Is there a way to edit the code so it gives me this option when I click the command button?
Thanks in advance for any suggestions/fixes
Code:
Sub OpenWordFedExDoc()
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open("G:\Insurance Claims\Claims Forms\FedEx Claim Form.doc")
wdApp.Visible = True
End Sub