View Single Post
 
Old 11-17-2023, 02:32 AM
fd110 fd110 is offline Windows 10 Office 2021
Novice
 
Join Date: Nov 2023
Posts: 7
fd110 is on a distinguished road
Default text formatting lost

Quote:
Originally Posted by gmayor View Post
My old friend Greg jumped in and took over the thread, but to address your concerns with my original macro try
Code:
Sub Macro1()
Dim oRng As Range
Dim strText As String
Dim i As Long
    Set oRng = ActiveDocument.Range
    i = 1
    With oRng.Find
        Do While .Execute(FindText:="\[\[(*)\]\]", _
                          MatchWildcards:=True)
            strText = Replace(oRng.Text, "[", "")
            strText = Replace(strText, "]", "")
            ActiveDocument.Footnotes.Add oRng, CStr(i), strText
            oRng.Text = ""
            i = i + 1
            oRng.Collapse 0
        Loop
    End With
lbl_Exit:
    Set oRng = Nothing
    Exit Sub
End Sub
If that doesn't work for you, post a sample from the document.

text formatting like bold & etc lost!
Reply With Quote