FollwoHyperlink from dotm template (WORD 2007)

T

theiviaxx

So i have a .dotm template that i am using to add a custom ribbon
tab. On this tab there is a button to launch a URL. I am using
Word.ActiveDocument.FollowHyperlink to do so. If i supply this method
with a string like:

"http://www.google.com"

it works fine. However, if i supply it with a variable:

Dim url As String
url = "http://google.com"
Word.ActiveDocument.FollowHyperlink url

it errors saying "Command failed". I have had other try it and its
hit or miss on there machines. I think i have narrowed it down to:

A) The macros in the template are not done properly or in the wrong
place
B) The method acts differently when called from a template

I think its something like that, but i really have no idea what the
problem is. Am i missing something?

Thanks
 

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