custom format hyperlink

M

Michael Vestel

I need to figure out how to make my own styled hyperlink or the likes. my
editor requires links to be in the following format:

<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>


but what you read in the above example would be: D.O.E.’s Lighting Facts
program

I'd like to figure out a way to insert this but not to read like this
paragraph below, as its very hard to read this:


The trouble is, the label’s use is not always legitimate. Since <a
href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>
launched in December of 2008 there have been 25 cases of label misuse,
according to

do you have any suggestions?
 
M

Michael Vestel

This is the normal hyperlink approach, but the end result is that if you show
codes (alt F9), you get:
{ HYPERLINK "http://www.lightingfacts.com/" }


Instead, i'm tring to get the code to look as required by our web languange:

<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>

I know this seems odd, but i want to be able to switch between seeing just
"D.O.E.’s Lighting Facts program" as hyperlink and the actual text:
<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>

so i can read the text easily...

its a CUSTOM Hyperlink i guess. is there another way?

macropod said:
Hi Michael,

1. Go to Insert|Hyperlink.
2. In the 'file or web page name' box, enter the url (http://www.lightingfacts.com/)
3. In the 'text to display' box, replace the url with 'D.O.E.’s Lighting Facts program'

--
Cheers
macropod
[Microsoft MVP - Word]


Michael Vestel said:
I need to figure out how to make my own styled hyperlink or the likes. my
editor requires links to be in the following format:

<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>


but what you read in the above example would be: D.O.E.’s Lighting Facts
program

I'd like to figure out a way to insert this but not to read like this
paragraph below, as its very hard to read this:


The trouble is, the label’s use is not always legitimate. Since <a
href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>
launched in December of 2008 there have been 25 cases of label misuse,
according to

do you have any suggestions?
 
S

Stefan Blom

In Word, hyperlinks are Hyperlink fields. To show them as HTML code, you
will have to save the document as HTML, and then view the source.

--
Stefan Blom
Microsoft Word MVP



Michael Vestel said:
This is the normal hyperlink approach, but the end result is that if you
show
codes (alt F9), you get:
{ HYPERLINK "http://www.lightingfacts.com/" }


Instead, i'm tring to get the code to look as required by our web
languange:

<a href="http://www.lightingfacts.com/">D.O.E.'s Lighting Facts
program</a>

I know this seems odd, but i want to be able to switch between seeing just
"D.O.E.'s Lighting Facts program" as hyperlink and the actual text:
<a href="http://www.lightingfacts.com/">D.O.E.'s Lighting Facts
program</a>

so i can read the text easily...

its a CUSTOM Hyperlink i guess. is there another way?

macropod said:
Hi Michael,

1. Go to Insert|Hyperlink.
2. In the 'file or web page name' box, enter the url
(http://www.lightingfacts.com/)
3. In the 'text to display' box, replace the url with 'D.O.E.'s Lighting
Facts program'

--
Cheers
macropod
[Microsoft MVP - Word]


message
I need to figure out how to make my own styled hyperlink or the likes.
my
editor requires links to be in the following format:

<a href="http://www.lightingfacts.com/">D.O.E.'s Lighting Facts
program</a>


but what you read in the above example would be: D.O.E.'s Lighting
Facts
program

I'd like to figure out a way to insert this but not to read like this
paragraph below, as its very hard to read this:


The trouble is, the label's use is not always legitimate. Since <a
href="http://www.lightingfacts.com/">D.O.E.'s Lighting Facts
program</a>
launched in December of 2008 there have been 25 cases of label misuse,
according to

do you have any suggestions?
 
M

macropod

Hi Michael,

What Word shows when you press Alt-F9 is the field code for how Word stores the hyperlink - it doesn't need or use the HTML
hyperlink format for this. If you want/need the correct HTML format, you could save the document as a web page and extract the link
from there. Other than that, you're not going to get a hyperlink that normally looks like:
D.O.E.’s Lighting Facts program
but displays as:
<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>
when you press Alt-F9. For export to your web page, you could run a macro to render the link as required. For example:
Sub HLink_2_HTML()
Dim oFld As Field, StrPath As String, StrName As String
For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldHyperlink Then
StrPath = Trim(Replace(Replace(oFld.Code, "HYPERLINK", ""), """", ""))
oFld.Select
With Selection
StrName = oFld.Result
.Text = StrPath
.Font.Underline = wdUnderlineNone
If InStr(StrPath, "@") > 0 Then
.InsertBefore "<a href=""mailto:"
Else
.InsertBefore "<a href="" "
End If
.InsertAfter """>" & StrName & "</a>"
End With
End If
Next
End Sub

--
Cheers
macropod
[Microsoft MVP - Word]


Michael Vestel said:
This is the normal hyperlink approach, but the end result is that if you show
codes (alt F9), you get:
{ HYPERLINK "http://www.lightingfacts.com/" }


Instead, i'm tring to get the code to look as required by our web languange:

<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>

I know this seems odd, but i want to be able to switch between seeing just
"D.O.E.’s Lighting Facts program" as hyperlink and the actual text:
<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>

so i can read the text easily...

its a CUSTOM Hyperlink i guess. is there another way?

macropod said:
Hi Michael,

1. Go to Insert|Hyperlink.
2. In the 'file or web page name' box, enter the url (http://www.lightingfacts.com/)
3. In the 'text to display' box, replace the url with 'D.O.E.’s Lighting Facts program'

--
Cheers
macropod
[Microsoft MVP - Word]


Michael Vestel said:
I need to figure out how to make my own styled hyperlink or the likes. my
editor requires links to be in the following format:

<a href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>


but what you read in the above example would be: D.O.E.’s Lighting Facts
program

I'd like to figure out a way to insert this but not to read like this
paragraph below, as its very hard to read this:


The trouble is, the label’s use is not always legitimate. Since <a
href="http://www.lightingfacts.com/">D.O.E.’s Lighting Facts program</a>
launched in December of 2008 there have been 25 cases of label misuse,
according to

do you have any suggestions?
 

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