Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Hyperlink modifications

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
annasProgram - 27 Nov 2006 13:14 GMT
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
Jonathan West - 27 Nov 2006 13:40 GMT
>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
[quoted text clipped - 3 lines]
> 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.
[quoted text clipped - 6 lines]
> 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.

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.