So what I'm trying to do, is programatically create hyperlinks in a word document and point them to text written as a heading in another part of the word document. Easy enough to do by right clicking and selecting the correct option. So I figured I'd start by recording a macro doing exactly that. This is the result:


ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="", _
SubAddress:="_Yet_more_text.", ScreenTip:="", TextToDisplay:="Link "


Now the wierd part. Creating the hyperlink through the menu works fine (ie. I click it and it goes where i expect it to), but if I run the above macro, the link that is created sends me to the top of the document instead of to the specified heading! Almost like it doesn't recognize the address.

Has anyone seen this before and can point out what I'm doing wrong? I'm using Word 2000 SP3, On XP SP2 (I've tried the same thing on several different machines with different OS's and different Word versions with the same result).

Thanks