![]() |
|
#1
|
||||
|
||||
![]()
Try the following macro:
Code:
Sub Demo() Dim i As Long, StrTxt As String, StrOut As String With ActiveDocument For i = .Hyperlinks.Count To 1 Step -1 With .Hyperlinks(i) StrTxt = .TextToDisplay If StrTxt Like "[#@]*" Then .Range.Fields(1).Unlink ElseIf InStr(StrTxt, "@") > 0 Then StrOut = Mid(StrTxt, InStr(StrTxt, "@") - 1, Len(StrTxt)) .Range.InsertAfter StrOut .TextToDisplay = Left(StrTxt, InStr(StrTxt, "@") - 2) End If End With Next End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
netchie | Word VBA | 5 | 03-15-2013 04:22 PM |
![]() |
PRADEEPB270 | Excel | 1 | 02-22-2013 09:47 AM |
![]() |
Jamal NUMAN | Word | 1 | 07-08-2011 05:40 PM |
![]() |
losty. | Word | 2 | 10-05-2010 01:21 AM |
How to remove the UNDERLINE from a hyperlink text? | Learner7 | PowerPoint | 3 | 05-17-2010 09:35 PM |