hi
i have a word document which is connected to a database via vba. i am able to extract text from the database and display in on the page.
how do i insert this text from the database into word as a hyperlink?
thanks
Printable View
hi
i have a word document which is connected to a database via vba. i am able to extract text from the database and display in on the page.
how do i insert this text from the database into word as a hyperlink?
thanks
You can change this to use variables.
VB Code:
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="http://www.vbforums.com", SubAddress:="", ScreenTip:="", TextToDisplay:="vbforums"
Excellent
I will be trying that out in a bit. Will let you know if it works!
Thanks
no i can't get it to work. basically i want the hyperlink to be added to a certain bookmark. the following code i have and it gives an error
ActiveDocument.Hyperlinks.Add Anchor:=SetBookmark "bmEmail", Address:="Mailto:" & strEmail, SubAddress:="", ScreenTip:="", TextToDisplay:="Email"
Ok i now have this code which adds the dynamic hyperlink NEXT to the bookmark. How to I insert it INTO the bookmark?
VB Code:
ActiveDocument.Bookmarks("bkEmail").Select ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="mailto:" & strEmail, TextToDisplay:=strEmail