Danke Dir, so hat es funktioniert:
Sub LinkBearbeiten()
'
' LinkBearbeiten Makro
'
'
Dim doc As Word.Document
Dim hlk As Word.Hyperlink
Dim strAddress As String
Dim strSubAdress As String
Dim zaehler As Integer
Dim AText As String
Dim PText As String
Dim NewAdress As String
Const such As String = "W-"
Set doc = ActiveDocument
For Each hlk In doc.Hyperlinks
'Anzeigetext auslesen
AText = hlk.TextToDisplay
'Nur wenn Anzeigetext W- beinhaltet
If InStr(AText, such) > 0 Then
'Alte Adresse auslesen
strAddress = hlk.Address
'SubAdresse auslesen
strSubAdress = hlk.SubAddress
'Neue Adresse setzen
NewAdress = strAddress & "?autoplay=o"
hlk.Address = NewAdress
zaehler = zaehler + 1
End If
Next hlk
MsgBox (zaehler & " Hyperlinks bearbeitet")
End Sub
|