U
umpty
I would like to programmatically set a hyperlink "Address"
property from within a word document. I have not been
successful thus far. Below is a snippet of code that I'm
using:
THE FOLLOWING IS WHAT I WOULD LIKE TO SET THE "ADDRESS" TO:
MyFileName1 = "Linked#NUREG-1801/" & docName & "#B" &
MyIdentifier & ""
Public Sub UpdateHyperlink()
Dim ws1 As DAO.Workspace
Dim db1 As DAO.Database
Dim rst1 As DAO.Recordset
Dim MyFileName1 As String
Dim doc1 As Document
Set doc1 = ActiveDocument
Dim docName
Dim tempHyperlink As Hyperlink
docName = doc1.Name
MyFileName1 = "Linked#NUREG-1801/" & docName & "#B" &
MyIdentifier & ""
Set ws1 = CreateWorkspace("NewJetWorkspace", "admin", "",
dbUseJet)
Set db1 = ws1.OpenDatabase("C:\Gall\Update
Database\Gall2002.mdb")
Set rst1 = db1.OpenRecordset("Change Table", dbOpenDynaset)
rst1.FindFirst "tempSelect = 'Selected'"
If Not IsNull(rst1!tempSelect) Then
rst1.Edit
rst1!Hyperlink = "B" & MyIdentifier
(would i set the 'address' property here?
rst1.Update
End If
rst1.Close
Set rst1 = Nothing
db1.Close
Set db1 = Nothing
ws1.Close
Set ws1 = Nothing
End Sub
property from within a word document. I have not been
successful thus far. Below is a snippet of code that I'm
using:
THE FOLLOWING IS WHAT I WOULD LIKE TO SET THE "ADDRESS" TO:
MyFileName1 = "Linked#NUREG-1801/" & docName & "#B" &
MyIdentifier & ""
Public Sub UpdateHyperlink()
Dim ws1 As DAO.Workspace
Dim db1 As DAO.Database
Dim rst1 As DAO.Recordset
Dim MyFileName1 As String
Dim doc1 As Document
Set doc1 = ActiveDocument
Dim docName
Dim tempHyperlink As Hyperlink
docName = doc1.Name
MyFileName1 = "Linked#NUREG-1801/" & docName & "#B" &
MyIdentifier & ""
Set ws1 = CreateWorkspace("NewJetWorkspace", "admin", "",
dbUseJet)
Set db1 = ws1.OpenDatabase("C:\Gall\Update
Database\Gall2002.mdb")
Set rst1 = db1.OpenRecordset("Change Table", dbOpenDynaset)
rst1.FindFirst "tempSelect = 'Selected'"
If Not IsNull(rst1!tempSelect) Then
rst1.Edit
rst1!Hyperlink = "B" & MyIdentifier
(would i set the 'address' property here?
rst1.Update
End If
rst1.Close
Set rst1 = Nothing
db1.Close
Set db1 = Nothing
ws1.Close
Set ws1 = Nothing
End Sub