none
Converting Foot Notes to plain text RRS feed

  • Question

  • Hi Everyone,

    Does anyone knows, how to retrieve the Foot Notes references using VBA Macros? I have already tried with Footnote.Reference.Text but it is not giving any reference numbers. When i am debugging the Code it shows some box like symbols.

    Please let me know the solution asap.

    Thanks,


    Shahab Abbasi

    Tuesday, January 14, 2014 1:43 PM

Answers

All replies

  • Hi Shahab

    As far as I can tell, it's not possible - at least, not without a lot of code to work out which options are set for the footnotes so that you can calculate the number based on a combination of location and index number. See this discussion

    http://www.vbaexpress.com/forum/showthread.php?31231-Activedocument-Footnotes-Reference-Text

    The information isn't even stored in the Word Open XML, as best I can tell Word calculates it completely on-the-fly.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 14, 2014 3:46 PM
    Moderator
  • Thanks Cindy

    Shahab Abbasi

    Wednesday, January 15, 2014 12:42 PM
  • I think you could do it indirectly as follows, but you would have to be able to modify the document and be able to insert a { NOTEREF } field at whatever point you choose:

    Sub getfootnoteref(fnrRange As Word.Range)
    Dim f As Word.Field
    Dim r As Word.Range
    Set r = fnrRange
    r.Bookmarks.Add "tempfnr", r
    r.Collapse wdCollapseEnd
    Set f = r.Fields.Add(r, wdFieldEmpty, " NOTEREF ""tempfnr"" ", False)
    Debug.Print f.Result
    Set f = Nothing
    Set r = Nothing
    ActiveDocument.Undo 2
    End Sub
    
    Sub testGetFooteNoteRef()
    Call getfootnoteref(Selection.Range)
    End Sub
    


    Peter Jamieson

    Wednesday, January 15, 2014 4:05 PM