I'm developing an Excel macro with VBA to create add a hyperlink in a Word template. I've added a bookmark in the template, where the hyperlink should go, called "WebAdd". I've tried using the code below and am getting a Type Mismatch error. Any suggestions would be greatly appreciated...
"MyWebAdd" is the web address for the hyperlink
WrdApp.ActiveDocument.Hyperlinks.Add Anchor:=MyWebAdd, Address:="", SubAddress:="WebAdd", ScreenTip:="", TextToDisplay:=MyWebAdd
I've also used the following code. It puts the web address at the bookmark but it is not a hyperlink a user can click on. The bookmark name has the correct bookmark and the MyWebAdd variable has the correct web address
WrdApp.ActiveDocument.Bookmarks(BookMarkName).Select
WrdApp.Selection.GoTo What:=wdGoToBookmark, Name:=BookMarkName
WrdApp.Selection.TypeText MyWebAdd
Thanks for your help with this issue.....