user_mobilelogo

Pour tout connaître sur Word
Nouvelle version !

600 pages !

9,80 € 

En savoir plus.

  1. Une solution simple : coller le texte dans wordpad (format RTF) puis le recoller depuis wordpad dans word.

    ou bien
  2. Une macro. Si le rose ne convient pas , on peut le changer !

Public Sub AfficherURL()
'Macro écrite par Guy Moncomble
'Ce code peut être simplifié
Dim HyperLien As Field, ResultatRequèteUrl As String
Dim CodeChampUrl As String
Dim TrueURL As String
For Each HyperLien In ActiveDocument.Fields
HyperLien.Select
Selection.Collapse wdCollapseEnd
If HyperLien.Type = wdFieldHyperlink Then
'Texte affiché
ResultatRequèteUrl = HyperLien.Result
CodeChampUrl = HyperLien.Code
'Insérer URL
TrueURL = URLDansChamp(CodeChampUrl)
Selection.InsertAfter Chr(32)
Selection.Collapse wdCollapseEnd
Selection.InsertAfter " ( " & TrueURL & " ) "
Selection.Range.Font.ColorIndex = wdPink
Selection.Collapse wdCollapseEnd
Selection.MoveLeft unit:=wdCharacter, Extend:=wdExtend
Selection.Range.Font.ColorIndex = wdAuto
End If
Next HyperLien
End Sub

Public Function URLDansChamp(ResultatURL As String)
' Macro écrite par Guy Moncomble
Dim Pos1 As Integer, URL As String
'Le texte est du type : HYPERLIEN "URL"
Pos1 = InStr(ResultatURL, Chr(34))
URL = Mid(ResultatURL, Pos1 + 1)
URLDansChamp = Left(URL, Len(URL) - 1)
End Function

 


Voir aussi...

Statistiques

Aujourd'hui933
Hier2750
Cette semaine6396
Ce mois67181
Total depuis 200414840158

43
visiteurs actuellement en ligne

29 mars 2023