NiceButDim
Programmer
Hopefully I’m in the right forum for this question; I need a macro the will convert a line of text into a hyperlink.
I thought it would be a simple matter of recording a macro. However when I run my macro it literally pastes the text of the line that I used when recording the macro.
I put the cursor at the start of ‘Line One’ and recorded my macro. The macro looks as follows;
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"Line%20One", SubAddress:="", ScreenTip:="", TextToDisplay:="Line One"
Anyone know how I could change the ‘Address’ & ‘TextToDisplay’ elements to display whats now in the clipboard rather than the literals ‘Line One’ every time?
Thanks.
john.
I thought it would be a simple matter of recording a macro. However when I run my macro it literally pastes the text of the line that I used when recording the macro.
I put the cursor at the start of ‘Line One’ and recorded my macro. The macro looks as follows;
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"Line%20One", SubAddress:="", ScreenTip:="", TextToDisplay:="Line One"
Anyone know how I could change the ‘Address’ & ‘TextToDisplay’ elements to display whats now in the clipboard rather than the literals ‘Line One’ every time?
Thanks.
john.