J
jdonkers
I am trying to move through some text and change some to hyperlinks as below
--Before (all text)---------------------
Test1-----Move to T2
Test2-----Move to T1
----------------------------------------
After-->The "Move to T2" and "Move to T1" will be hyperlinks to Test2 and
Test1 respectively.
If I put a watch on aRange I see the following as written in the comments
for the code I am using.
Dim aRange as Word.Range
Set aRange = ActiveDocument.Range(Start:=10, End:=20)
' Watch says "Move to T2" as expected, and aRange.End is 20.
ActiveDocument.Hyperlinks.Add Anchor:=aRange,
Address:=ActiveDocument.FullName, SubAddress:="Test2"
' Watch still says "Move to T2" as expected, but aRange.End changed from 20
to 123.
Set aRange = ActiveDocument.Range(Start:=30, End:=40)
' Watch says "uments and" instead of "Move to T1" as expected. This looks
like part of the path name
Could someone please explain what's going on and what I am doing wrong?
--Before (all text)---------------------
Test1-----Move to T2
Test2-----Move to T1
----------------------------------------
After-->The "Move to T2" and "Move to T1" will be hyperlinks to Test2 and
Test1 respectively.
If I put a watch on aRange I see the following as written in the comments
for the code I am using.
Dim aRange as Word.Range
Set aRange = ActiveDocument.Range(Start:=10, End:=20)
' Watch says "Move to T2" as expected, and aRange.End is 20.
ActiveDocument.Hyperlinks.Add Anchor:=aRange,
Address:=ActiveDocument.FullName, SubAddress:="Test2"
' Watch still says "Move to T2" as expected, but aRange.End changed from 20
to 123.
Set aRange = ActiveDocument.Range(Start:=30, End:=40)
' Watch says "uments and" instead of "Move to T1" as expected. This looks
like part of the path name
Could someone please explain what's going on and what I am doing wrong?