I have a Word document in a field in a table. I've looked around but cant find how i can open this via code, ie on click of a button.
I currently have the following which referneces from a specific path name, but ideally i'd like the Instructions file to be packaged within the db, hence my question.
I'm assuming this is fairly easy to do....?
cheers
Ad
I currently have the following which referneces from a specific path name, but ideally i'd like the Instructions file to be packaged within the db, hence my question.
Code:
Dim strDocPath As String
Dim dbs As Database
Dim objApp As Object
On Error GoTo err1
strDocPath = "c:\program files\scoms\Instructions.doc"
Set objApp = GetObject(, "Word.Application")
With objApp
.Documents.Open (strDocPath)
.ActiveDocument.PrintPreview
.Visible = True
End With
Set objWord = Nothing
err1:
If Err.Number = 429 Then
Set objApp = CreateObject("Word.Application")
objApp.Visible = True
Resume Next
End If
cheers
Ad