Quote:
Originally Posted by gmayor
Maybe something like
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, _
ReplaceWith:="\1")
ActiveDocument.Footnotes.Add oRng, CStr(i), oRng.Text
i = i + 1
oRng.Collapse 0
Loop
End With
lbl_Exit:
Set oRng = Nothing
Exit Sub
End Sub
|
This works, thank you so much! (I'm not the one to judge, but: I looks really elegant too.)
Just one thing: The text between the brackets isn't deleted. It is transfered to the footnote, but it stays in the main art as well. How can I adapt the code get rid of the text in the main part?
Thanks!