S
samotek via AccessMonster.com
I my database i have a code that creates a word document. In this document i
create a hyperlink to my database using Insert-hyperlink.Can i create the
hyperlink in my fucntion by defining the path and the name of the database ?
Public Function MyNotes()
Dim appW As Object
Dim docW As Object
Dim nErr As Integer
Const strFile = "C:\Be\Notes.doc"
On Error Resume Next
Set appW = GetObject(, "Word.Application")
nErr = Err
On Error GoTo 0
If nErr Then
Set appW = CreateObject("Word.Application")
End If
' Does document exist?
If Dir(strFile) = "" Then
' If not, create it
Set docW = appW.Documents.Add
' And save it
docW.SaveAs strFile
Else
' If it does exist, open it
Set docW = appW.Documents.Open(strFile)
End If
appW.Visible = True
Set docW = Nothing
Set appW = Nothing
End Function
create a hyperlink to my database using Insert-hyperlink.Can i create the
hyperlink in my fucntion by defining the path and the name of the database ?
Public Function MyNotes()
Dim appW As Object
Dim docW As Object
Dim nErr As Integer
Const strFile = "C:\Be\Notes.doc"
On Error Resume Next
Set appW = GetObject(, "Word.Application")
nErr = Err
On Error GoTo 0
If nErr Then
Set appW = CreateObject("Word.Application")
End If
' Does document exist?
If Dir(strFile) = "" Then
' If not, create it
Set docW = appW.Documents.Add
' And save it
docW.SaveAs strFile
Else
' If it does exist, open it
Set docW = appW.Documents.Open(strFile)
End If
appW.Visible = True
Set docW = Nothing
Set appW = Nothing
End Function