View Single Post
 
Old 02-11-2016, 06:30 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Based on the clock, the mysterious one may have signed off for the day. It is elegant. I particularly like the lbl_Exit: Exit Sub part.

Code:
Sub Macro1()
Dim oRng As Range
Dim strText As String
Dim lngIndex As Long
  Set oRng = ActiveDocument.Range
  lngIndex = 1
  With oRng.Find
    While .Execute(FindText:="\[\[(*)\]\]", _
                   MatchWildcards:=True, _
                   ReplaceWith:="\1")
      ActiveDocument.Footnotes.Add oRng, CStr(lngIndex), oRng.Text
      lngIndex = lngIndex + 1
      oRng.Text = vbNullString
      oRng.Collapse 0
    Wend
  End With
lbl_Exit:
  Set oRng = Nothing
  Exit Sub
End Sub
You may find this interesting:
'http://gregmaxey.com/word_tip_pages/convert_reference_notes_to_dynamic_footnotes.html

A collaborative effort with Macropod.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote