Keystrokes were used to record this macro, but the insertion pointer must be precisely positioned for it to work: Click the insertion pointer before the parenthetical sentence, just before the period where you want the footnote to appear. The figure illustrates the positioning and the result after running the macro.
Sub parenthetical_to_footnote()
'
' parenthetical_to_footnote Macro
' Convert parenthetical text following the cursor into a footnote
'
Selection.Extend
Selection.Extend Character:="("
Selection.EscapeKey
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.Extend Character:=")"
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Cut
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="."
Selection.MoveLeft Unit:=wdCharacter, Count:=1
With Selection
With .FootnoteOptions
.Location = wdBottomOfPage
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
.LayoutColumns = 0
End With
.Footnotes.Add Range:=Selection.Range, Reference:=""
End With
Selection.Paste
End Sub
The following keystrokes were used to create this macro. They're pretty complex:
- Press F8 and then the ( (left parenthesis) character. The F8 command enters extended selection mode. When you press a key, such as the ( key, text is selected up to and including that character.
- Esc, → Selection is canceled, and the → key moves the insertion pointer to the start of the parenthetical text.
- F8, ) Text is selected up to and including the ) character.
- ← The ) character is removed from the selection.
- Ctrl+X The parenthetical text is cut. The next few keystrokes remove the parenthesis and position the insertion pointer for the footnote.
- Backspace, Backspace, Backspace, Backspace, . (period), ←
- Click the References tab and, in the Footnotes group, click the Insert Footnote button.
- Ctrl+V The text is pasted into the footnote.