Posts

Showing posts from November, 2025

Clear UTM references in MS Word

Attribute VB_Name = "DOC_Links" ' Module: UTM_Cleaner.bas Option Explicit Option Compare Text Public Sub CleanUTM () Dim doc As Document : Set doc = ActiveDocument Dim sr As Range , rng As Range Dim hl As Hyperlink Dim ils As InlineShape Dim shp As Shape Dim sec As Section , hf As headerFooter Dim fixed As Long Application.ScreenUpdating = False ' All story ranges For Each sr In doc.StoryRanges Set rng = sr Do For Each hl In rng.Hyperlinks fixed = fixed + CleanOneHyperlink ( hl ) Next hl For Each ils In rng.InlineShapes On Error Resume Next If Not ils.Hyperlink Is Nothing Then fixed = fixed + CleanOneHyperlink ( ils.Hyperlink ) On Error GoTo 0 Next ils Set rng = rng.NextStoryRange ...