View Single Post
Old 09-05-2008, 04:21 PM   #2
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,672
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Hi Hadrien,
Try this, see code comments proceeded with ' for descriptions
=X=

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
    
    'See the footnote text
    MsgBox oFoot.Range.Text
    
    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 + ">"
    Selection.InsertParagraphBefore
    Selection.InsertParagraphAfter
    Selection.Font.Bold = wdToggle
Next

Last edited by =X=; 09-05-2008 at 04:22 PM. Reason: Fixed typos
=X= is offline   Reply With Quote