Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting Footnote Reference (Word 2000+)

    Hi all,

    Anyone know how to get a footnote reference using VBA?
    The <pre>Reference.Text </pre>

    property of the Footnote object returns a non-printing character of ASCII value 2. I'd like the actual number/letter that shows up in the document. I also tried a roundabout way, trying to get it from the footnote text itself, but it doesn't show up there either.

    Any help would be greatly appreciated.

    Thanks!

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Getting Footnote Reference (Word 2000+)

    Try this
    <pre>Sub temp2()
    Dim aFt As Footnote
    For Each aFt In ActiveDocument.Footnotes
    Debug.Print aFt.Index & ": " & aFt.Range
    Next aFt
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Footnote Reference (Word 2000+)

    Hi Andrew,

    Yeah, I'd tried using the Index property, but it doesn't account for letters or roman numerals used as references, or for restarting over sections.

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Footnote Reference (Word 2000+)

    Hi Andrew,

    I fear you have to figure it out from the FootnoteOptions (.NumberStyle, .StartingNumber), and the footnote index.

    <img src=/S/frown.gif border=0 alt=frown width=15 height=15> Klaus

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Getting Footnote Reference (Word 2000+)

    Ahh... Can you harvest the contents of the text which uses the style Footnote Reference?

    What is the purpose for this task?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting Footnote Reference (Word 2000+)

    Hi Andrew,

    Just tried that, but I keep getting that non-printing character (ASCII value 2). <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    I was trying to write a macro that would generate a 2-column table of footnotes, with the paragraph containing the reference (and including the reference) in one column, and the footnote text in the other.

    Thanks for your help!

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Getting Footnote Reference (Word 2000+)

    This problem appears to be harder to solve than it should be.

    A fallback method may be to search the paragraph text for the bit that uses the 'Footnote Reference' character style. This will be complicated by multiple footnotes in one paragraph so it is certainly less than ideal but since you are already working with that paragraph perhaps you could go that way.

    But then again, you don't actually need the footnote reference separated out in the table as described that you are constructing. Have you tried browsing by footnotes which moves the cursor in front of the reference and then selecting the following word?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •