On 14 Dec 2003 14:14:10 -0800, in
in word 2002 is there anyway to covert every instance of a word in to
a hyperlink?
for example:
i want to replace every time my report says webpage with the word
webpage, but you can now click on the word and go to
www.cisco.com
Dan, probably the easiest way is to create a macro. If you don't know
how to Record a macro ... Select Tools->Macro->Record new macro. At
the prompt, replace "Macro1" with "web" (without the quotes). Click
the Keyboard button. Assign ALT+W (assuming it's currently unassigned
or choose ALT+ another letter) Close. Then close the Macro recording
bar (which looks more like a box than a bar!) that appears on your
screen. Next, select Tools->Macro->Macros. Select "web", then Edit.
Replace everything from
Sub web()
to
End Sub
with:
Sub web()
'
' web Macro
' Macro to find the word "webpage" and make it a hyperlink
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "webpage"
.Replacement.Text = "<a
href=""
http://www.cisco.com/>webpage</a>"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"
http://www.cisco.com/", SubAddress:="", ScreenTip:="",
TextToDisplay:= _
"webpage"
End Sub
Close the Visual Basic window and return to your document. Then just
hit ALT+W until you've converted each instance of "webpage" to a
hyperlink.
HTH
hro