View Single Post
 
Old 09-14-2025, 04:41 AM
chrisjj chrisjj is offline Windows 7 64bit Office 97-2003
Competent Performer
 
Join Date: Aug 2025
Posts: 120
chrisjj is on a distinguished road
Default

PS Version that fixes [ and {:

Code:
Option Explicit

Sub FixHyperlinkAddress()
' e.g.
' Was FAIL New PDF Document %5b.pdf
' Is FAIL New PDF Document [.pdf
Debug.Print ("---------")
    Dim hlink As Hyperlink
    For Each hlink In ActiveDocument.Hyperlinks
            Debug.Print ("Was " & hlink.Address)
            hlink.Address = Replace(hlink.Address, "%5b", "[")
            hlink.Address = Replace(hlink.Address, "%7b", "{")
            Debug.Print ("Is " & hlink.Address)
    Next hlink
    Beep
End Sub
and attached. Probably not fit for production.

PS The # case https://www.msofficeforums.com/word/...e-address.html is a different kind of fail and I can see no similar solution.
Attached Files
File Type: doc Filename char fail - VBA fix 2a.doc (64.5 KB, 0 views)
Reply With Quote