Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub HlinkChanger()
- Dim oRange As Word.Range
- Dim oField As Field
- Dim link As Variant
- With ActiveDocument
- .Range.AutoFormat
- For Each oRange In .StoryRanges
- For Each oFld In oRange.Fields
- If oFld.Type = wdFieldHyperlink Then
- For Each link In oFld.Result.Hyperlinks
- // the hyperlink is stored in link.Address
- // strip the first x characters of the URL
- // and replace them with your new URL
- Next link
- End If
- Next oFld
- Set oRange = oRange.NextStoryRange
- Next oRange
Add Comment
Please, Sign In to add comment