Hyperlink modifications

A

annasProgram

I defined a macro that replaces a selected text in a document with a
hyperlink. Depending on the marked text I want apply to the hyperlink
different properties, such as different color.

My question is how can I modify the properties of a hyperlink so that:
1. the hyperlink will be marked with a double line colored with green
2. the hyperlink will appear as it is e.g. capital letters

Another problem which I tried to overcome is how to change the address of
the hyperlink so it will open a new form.
The following code doesn’t work due to incomparable types in Address:
Dim oHpl As Hyperlink
Set oHpl = ActiveDocument.Hyperlinks.Add _
(Selection.Range, Address:=myForm.Show, TextToDisplay:=Selection)

Does Address only links to documents and websites or is possible to link the
hyperlink to a form? In this case how can this be accomplished?

Thank you in advance
Hanna
 
J

Jonathan West

annasProgram said:
I defined a macro that replaces a selected text in a document with a
hyperlink. Depending on the marked text I want apply to the hyperlink
different properties, such as different color.

My question is how can I modify the properties of a hyperlink so that:
1. the hyperlink will be marked with a double line colored with green
2. the hyperlink will appear as it is e.g. capital letters

You need to format the Font property of the hyperlink text as appropriate.
Note that the underline has to be the same colour as the text.
Another problem which I tried to overcome is how to change the address of
the hyperlink so it will open a new form.
The following code doesn’t work due to incomparable types in Address:
Dim oHpl As Hyperlink
Set oHpl = ActiveDocument.Hyperlinks.Add _
(Selection.Range, Address:=myForm.Show, TextToDisplay:=Selection)

Does Address only links to documents and websites or is possible to link
the
hyperlink to a form?

No, you can't link a hyperlink to a form.
In this case how can this be accomplished?

Use a macrobutton field instead. Set it to call a macro which in turn shows
your form.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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