Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    Create hyperlink (Access 2000)

    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:BeNotes.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
    ' 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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Create hyperlink (Access 2000)

    Once you have created or opened the document, you can insert a hyperlink with an instruction like this:
    docW.Hyperlinks.Add Anchor:=appW.Selection.Range, Address:=CurrentDb.Name, _
    TextToDisplay:="My Database"</code>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts