create hyperlink in word

M

MC

Hello,
I want to add a hyperlink to a bookmark in a word document and am
not having any success. The bookmark is named 'hyper"


Below is the relevant code.


doc.Hyperlinks.Add Address="http://www.blah.com/", Anchor="Link Name",
SubAddress=doc.Bookmarks("hyper")

This is returning a type mismatch.

Any help much appreciated.
 
T

TRM

I am just learning here, but I wanted to let you know, I am trying to do the
same thing, this seems to work for me (Partially because of your snippit. I
didn't have the "Anchor" set correctly!) so - here is what I have and it is
working (FINALLY!).

oDoc.Hyperlinks.Add Anchor:=rng, Address:=sText, SubAddress:="",
ScreenTip:="", TextToDisplay:=strTitle

The only real difference I can see is the subaddress. The only other thing
I could think of is how you have your "doc" reference set?? Good luck!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top