1
votes

In a Word document, I would like to select a word or a phrase using the mouse, and run a macro. The macro should:

  1. Insert a footnote at the end of my selected word or phrase.
  2. Copy the selected text to the footnote, but italicised, and followed by a colon.
1

1 Answers

4
votes

This should do it, when the foot note is added it should already be itallic! I also added a space after the comma ready for the next footnote.

     Sub AddFootNote()

        NewFootNote = Selection & Chr(44) & Chr(32)

        With Selection
            With .FootnoteOptions
                .Location = wdBottomOfPage
                .NumberingRule = wdRestartContinuous
                .StartingNumber = 1
                .NumberStyle = wdNoteNumberStyleArabic
            End With
            .Footnotes.Add Range:=Selection.Range, Text:=NewFootNote

        End With

    End Sub

-edit- If you want to ensure your foot notes are italic you can add this part.

With ActiveDocument.Styles("Footnote Text").Font
    .Italic = True
End With