Creating a hyplink to a url site on a user form created in word

G

gbpg

I have created hyperlinks on various tools like labels and buttons on an
excel userform but cannot get this to work in word. The code starts with
ActiveSheet. in excel what is the word equivalent or are there other methods?
 
G

gbpg

Sorry Tony:
I have a form and a label on it that I can click on in Excel I tried to put
this type of syntax in:

Private Sub Label14_Click()
' a [Company] I work for site safety
ThisWorkbook.FollowHyperlink
Address:="http://notrealname.fictionnet.com/content.asp?id=1111"
End Sub

In excel this works. In Word using a using form and label it does not. I
tried the ThisDocument but it doesn't work.
 
T

Tony Jollans

"doesn't work" still does not give me much to go on. It works for me.

What happens? Nothing? An error message? And what version of Word are you
using?

--
Enjoy,
Tony

gbpg said:
Sorry Tony:
I have a form and a label on it that I can click on in Excel I tried to
put
this type of syntax in:

Private Sub Label14_Click()
' a [Company] I work for site safety
ThisWorkbook.FollowHyperlink
Address:="http://notrealname.fictionnet.com/content.asp?id=1111"
End Sub

In excel this works. In Word using a using form and label it does not. I
tried the ThisDocument but it doesn't work.

Tony Jollans said:
Not very much to go on! You might be looking for ActiveDocument.
 
G

gbpg

I tried the below:
Private Sub Label114_Click()

' a [Company] I work for site safety
ThisDocument.FollowHyperlink _
Address:"=http://www.microsoft.com"
End Sub

the error is
compile error
syntx error
syntax error



Tony Jollans said:
"doesn't work" still does not give me much to go on. It works for me.

What happens? Nothing? An error message? And what version of Word are you
using?

--
Enjoy,
Tony

gbpg said:
Sorry Tony:
I have a form and a label on it that I can click on in Excel I tried to
put
this type of syntax in:

Private Sub Label14_Click()
' a [Company] I work for site safety
ThisWorkbook.FollowHyperlink
Address:="http://notrealname.fictionnet.com/content.asp?id=1111"
End Sub

In excel this works. In Word using a using form and label it does not. I
tried the ThisDocument but it doesn't work.

Tony Jollans said:
Not very much to go on! You might be looking for ActiveDocument.

--
Enjoy,
Tony

I have created hyperlinks on various tools like labels and buttons on an
excel userform but cannot get this to work in word. The code starts
with
ActiveSheet. in excel what is the word equivalent or are there other
methods?
 
T

Tony Jollans

It seems to me you are wandering around in the dark here and some basic
training might be in order. The reason for your error (assuming its not a
typo in your post) is that you have an equals sign inside quotes that ought
to be outside them.

You seem mixed up about Sheets and WorkBooks in code you say works in Excel,
and unable to simply change "Workbook" to "Document" without changing
something else as well. I am not going to begin to explain the (widely
misunderstood) difference between ThisWhatever and ActiveWhatever.

If I am mistaken, I apologise. If making the change I suggest above doesn't
help then please come back with some more detail.

--
Enjoy,
Tony

gbpg said:
I tried the below:
Private Sub Label114_Click()

' a [Company] I work for site safety
ThisDocument.FollowHyperlink _
Address:"=http://www.microsoft.com"
End Sub

the error is
compile error
syntx error
syntax error



Tony Jollans said:
"doesn't work" still does not give me much to go on. It works for me.

What happens? Nothing? An error message? And what version of Word are you
using?

--
Enjoy,
Tony

gbpg said:
Sorry Tony:
I have a form and a label on it that I can click on in Excel I tried to
put
this type of syntax in:

Private Sub Label14_Click()
' a [Company] I work for site safety
ThisWorkbook.FollowHyperlink
Address:="http://notrealname.fictionnet.com/content.asp?id=1111"
End Sub

In excel this works. In Word using a using form and label it does not.
I
tried the ThisDocument but it doesn't work.

:

Not very much to go on! You might be looking for ActiveDocument.

--
Enjoy,
Tony

I have created hyperlinks on various tools like labels and buttons on
an
excel userform but cannot get this to work in word. The code starts
with
ActiveSheet. in excel what is the word equivalent or are there other
methods?
 

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