View Single Post
 
Old 07-14-2016, 02:16 PM
jroger05 jroger05 is offline Windows XP Office 2003
Novice
 
Join Date: Aug 2010
Posts: 6
jroger05 is on a distinguished road
Default How to add a hyperlink in VBA to a bookmark within a document

I am trying to use the hyperlinks feature in VBA within word, but when I use the following code it is attempting to create the hyperlink as a link to an existing File or Web page. I want the hyperlink to point to a bookmark named link2create below within the current document. I thought using the address = "" would give me the current document but unfortunately it is not.

ActiveDocument.Hyperlinks.Add Anchor:=oRng, _
Address:="", _
SubAddress:=link2create, ScreenTip:="", _
TextToDisplay:=txt2cpy
Reply With Quote