# Can Word macro/VBA recognize/edit footnote references?

**URL:** <https://boards.straightdope.com/t/can-word-macro-vba-recognize-edit-footnote-references/471537>\
**Category:** Factual Questions\
**Created:** [November 6, 2008, 10:00pm UTC](https://boards.straightdope.com/t/can-word-macro-vba-recognize-edit-footnote-references/471537 "2008-11-06T22:00:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhythmdvl](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@Rhythmdvl](https://boards.straightdope.com/u/Rhythmdvl)\
**Post date:** [November 6, 2008, 10:00pm UTC](https://boards.straightdope.com/t/can-word-macro-vba-recognize-edit-footnote-references/471537/1 "2008-11-06T22:00:02Z")

</div>

Is it possible to write a macro/vba code in Word (2000 or Mac; upgrading the version may be in the cards if necessary) to find foot/endnote references in a document and copy them in a different format?

I’m not sure if I’m phrasing this well, so here’s the end goal:  
We want to take a Word document with foot- or endnotes and import it into Quark (6 now, 8 soon). When Quark imports a document from Word, it skips over the footnote reference (the number) and instead inserts a blank space. It doesn’t import the footnotes at all (well, there are ways to shuffle things, but that’s a different question).

If, however, we could first have Word go through the document and every time it sees a footnote reference, change it to plain superscripted (or bold, or something identifiable) text that matches the original (i.e., it would keep the numbering), life would be extraordinarily easier.

We primarily do layout work on a Mac (so Applescript may be an option), but work on the text on a PC – so both platforms are available.

Any thoughts?

Thanks,

Rhythm

---

<div class="post-metadata">

**Author:** ![jormundgondir](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@jormundgondir](https://boards.straightdope.com/u/jormundgondir)\
**Post date:** [November 7, 2008, 7:04am UTC](https://boards.straightdope.com/t/can-word-macro-vba-recognize-edit-footnote-references/471537/2 "2008-11-07T07:04:36Z")

</div>

Well, I just finished this up and then realized that I think I misinterpreted your original request: what the following does is replace the footnote reference with a super-scripted footnote number with the actual text content of the footnote itself also included in the superscript. If that’s helpful to you, dandy! If not, just replace

```
    ftstr = ft.Range.Text
    r1.InsertAfter Str(ft.Index) & ftstr
    ActiveDocument.Range(mark, mark + Len(Str(ft.Index) & ftstr)).Font.Superscript = True

```

with:

```
    r1.InsertAfter Str(ft.Index)
    ActiveDocument.Range(mark, mark + Len(Str(ft.Index))).Font.Superscript = True

```

You will no doubt need to fiddle around with it a bit, but this should get you going in the right direction…

Sub fixie()  
Dim ft As Footnote

```
Dim r1 As Range, ftstr As String, mark

For Each ft In Word.ActiveDocument.Footnotes
    Debug.Print ft.Index & ft.Range.Text
    mark = ft.Reference.Start
    Set r1 = ActiveDocument.Range(ft.Reference.Sentences(1).Start, ft.Reference.Start)
    ftstr = ft.Range.Text
    r1.InsertAfter Str(ft.Index) & ftstr
    ActiveDocument.Range(mark, mark + Len(Str(ft.Index) & ftstr)).Font.Superscript = True
Next ft
For Each ft In Word.ActiveDocument.Footnotes
    ft.Delete
Next ft

```

End Sub

---

<div class="post-metadata">

**Author:** ![Scarlett67](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/scarlett67/32/7387_2.png) [@Scarlett67](https://boards.straightdope.com/u/Scarlett67)\
**Post date:** [November 7, 2008, 2:08pm UTC](https://boards.straightdope.com/t/can-word-macro-vba-recognize-edit-footnote-references/471537/3 "2008-11-07T14:08:10Z")

</div>

Check out NoteStripper at [The Editorium](http://www.editorium.com):

> [@The Editorium](#):
>
> NoteStripper strips Word’s embedded, automatically-numbering notes as numbered text to the end of a document, replacing the automatic reference numbers with superscript numbers. It’s a useful program for people who need to turn notes into actual text, perhaps to be imported into QuarkXPress or PageMaker. But that’s not all; NoteStripper works the other way, too, turning plain-text notes into embedded, automatically-numbering ones, so you can edit notes without having to renumber them manually. Then, if you need to, you can turn them back into text notes before sending them off to the typesetter. NoteStripper also makes it possible to convert parenthetical notes to embedded ones and vice versa, and it provides a variety of other tools to make working with notes a snap. The program includes batch processing for all open documents or all documents in a directory.

It’s available for Mac and PC and has a 45-day free trial.

Usual disclaimers: I (and many editors, publishers, and corporations) am just a very happy customer who uses several Editorium tools every day. Jack Lyon, the owner, gives the best tech support I’ve ever encountered.
