Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Last active April 26, 2021 15:46
Show Gist options
  • Save JoeGlines/8de12a74b27b9c27aabe00e3b3bcf778 to your computer and use it in GitHub Desktop.
Save JoeGlines/8de12a74b27b9c27aabe00e3b3bcf778 to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
;**************************************
OldString:="udeGU"
NewString:="nws"
;*******************************************************
;~ doc.ActiveDocument.Hyperlinks.Add(oWord.Selection.Range, Address,"","",TextToDisplay) ;what I started from
doc:=ComObjActive("Word.Application") ;Connect to open Word file
loop, % doc.ActiveDocument.Hyperlinks.count {
oldLink:=doc.ActiveDocument.Hyperlinks[a_index].Address ; the original address
doc.ActiveDocument.Hyperlinks[a_index].Address :=StrReplace(oldLink,OldString,NewString)
}
MsgBox % "performed " doc.ActiveDocument.Hyperlinks.count " replacements"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment