Hi all,
I'm finally down to my last hangup on this database that I'm working on. I just wanted to thank everyone here that helps out, the discussions here have helped me more then I could have imagined as I knew absolutley nothing about access or vba.
Ok, now on to question at hand. Right now I have a module that basically opens a MS Word doc, and prints it from a button on a form. However I would like it to drop something from a textbox called "txtWorkOrderID" on that form at a bookmark I have set on the Word doc. The bookmark is called "WO". Here is the code I am working with now.
Option Compare Database
Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Function Test()
On Error GoTo Err_Test
'Open file
ShellExecute 0, "Open", "file:///G:\Bulletin Board\UP Billing Flags\UP 1.2 - Health and Safety Plan.doc", "", "", 1
'Print file
ShellExecute 0, "Print", "file:///G:\Bulletin Board\UP Billing Flags\UP 1.2 - Health and Safety Plan.doc", "", "", 0
Exit_Test:
Exit Function
Err_Test:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Test
End Function
I'm finally down to my last hangup on this database that I'm working on. I just wanted to thank everyone here that helps out, the discussions here have helped me more then I could have imagined as I knew absolutley nothing about access or vba.
Ok, now on to question at hand. Right now I have a module that basically opens a MS Word doc, and prints it from a button on a form. However I would like it to drop something from a textbox called "txtWorkOrderID" on that form at a bookmark I have set on the Word doc. The bookmark is called "WO". Here is the code I am working with now.
Option Compare Database
Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Function Test()
On Error GoTo Err_Test
'Open file
ShellExecute 0, "Open", "file:///G:\Bulletin Board\UP Billing Flags\UP 1.2 - Health and Safety Plan.doc", "", "", 1
'Print file
ShellExecute 0, "Print", "file:///G:\Bulletin Board\UP Billing Flags\UP 1.2 - Health and Safety Plan.doc", "", "", 0
Exit_Test:
Exit Function
Err_Test:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Test
End Function