View Single Post
 
Old 02-12-2023, 07:16 PM
AlanCantor AlanCantor is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Nov 2020
Posts: 154
AlanCantor is on a distinguished road
Default

It's not hard to select text via VBA. It's also not difficult to place selected text into a footnote. You won't even have to copy and paste!

One of the questions you might have to ask is how much text do you want to select? A paragraph? A sentence?

Be aware that Word considers "Hello Dr. Honey, how are you?" as two sentences because of the period after "Dr":

"Hello Dr." and
"Honey, how are you?"

This script may not do exactly what you want, but hopefully it will give you ideas. The script selects a sentence and inserts it as a footnote.
Code:
    Dim x As String
    With Selection
        .Collapse       ' Start by collapsing current selection
        .Extend         ' Select the entire sentence
        .Extend
        .Extend
    End With
    Let x = Selection
    Selection.Footnotes.Add Range:=Selection.Range, Text:=x
Reply With Quote