VBA footnotes to inline text

Joined
Dec 10, 2009
Messages
1
Reaction score
0
Hi,
I would like to move the contents of a footnote in place of references to it (between characters |)

I found this macro:

Code:
Dim oFeets As Footnotes
Dim oFoot As Footnote
Dim oRange As Range
Dim szFootNoteText As String

' Grabs the collection of FootNotes
Set oFeets = Word.ActiveDocument.Footnotes

' Iterates through each footnote
For Each oFoot In oFeets
    
    szFootNoteText = oFoot.Range.Text
    
    'Start search from beginning of document
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    
    With Selection.Find
        .Text = "^f" ' Looks for all footnotes
        .Forward = True
        .Wrap = wdFindStop
    End With
    
    Selection.Find.Execute
    ' Delete the footnote
    oFoot.Delete
    
    'Insert the footnote text
    'Here you do whatever format tickles your fancy
    Selection.Text = "|" + szFootNoteText + "|"
    
Next

- Is almost good, but unfortunately the copied text loses formatting (like bold, italic).

How can I keep the formatting?

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top