View Single Post
 
Old 01-22-2023, 07:09 PM
Charles Kenyon Charles Kenyon is offline Windows 11 Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,536
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I would not attempt stripping it from the clipboard, but from the pasted text. If necessary, you could create a scratch document, paste it there, and clear it from the pasted text, then copy that and close the scratch document without saving, then you would have it in the clipboard.

Here is a macro that unlinks all hyperlinks in the first table of a document.

Code:
Sub HyperlinkFieldUnlink()
    '   Charles Kenyon 2023-01-22
    Dim oField As Field
    Dim oRange As range
    On Error Resume Next
    Set oRange = ActiveDocument.Tables(1).range
    For Each oField In oRange.Fields
        If oField.Type = wdFieldHyperlink Then
            oField.Unlink
        End If
    Next oField
    Set oField = Nothing
    On Error GoTo -1
    Set oRange = Nothing
End Sub
Reply With Quote