Word2003 Footnotes - enhanced

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15826
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Word2003 Footnotes - enhanced

Post by ChrisGreaves »

Word2003 Footnotes

As far as I can tell, A Word2003 Footnote is inserted as a single character string or symbol, by default a decimal digit string.
The symbol can be changed (Insert, refereNce, Footnote, Symbol) but one cannot specify, as an example, parentheses({[ ]}) around a footnote number.

Thus one can use “1”, “2”, “3” and so on, without the quotes, as footnote symbols, but one cannot generate by the Word2003 menu system “(1)”, “(2)”, “(3)”.

The parentheses must be inserted manually or by a macro.

Here (ATTACHED) is a crude macro that supplies a few basic options. The macro is not robust. It makes no checks on parameters, whether any text has been selected, whether the character style exists and so on. In particular I have not tested the character/word movements exhaustively({[ ]}) although it seems to have worked twice here.

Code: Select all

Function FootnoteParen(strFootnoteText As String, strCharacterStyleName As String, strLeft As String, strRight As String)
' FootnoteParen Macro
' Macro recorded 04/08/2018 by Chris069
'
    With ActiveDocument.Range(Start:=ActiveDocument.Content.Start, End:= _
        ActiveDocument.Content.End)
        With .FootnoteOptions
            .Location = wdBottomOfPage
            .NumberingRule = wdRestartContinuous
            .StartingNumber = 1
            .NumberStyle = wdNoteNumberStyleArabic
        End With
        .Footnotes.Add Range:=Selection.Range, Reference:=""
    End With
    Selection.TypeText Text:=strFootnoteText
    ActiveWindow.ActivePane.Close
    Selection.TypeText Text:=strRight
    Selection.MoveLeft Unit:=wdWord, Count:=1
    Selection.TypeText Text:=strLeft
    Selection.MoveLeft Unit:=wdWord, Count:=1
    Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
    Selection.Style = ActiveDocument.Styles(strCharacterStyleName)
    Selection.MoveRight Unit:=wdWord, Count:=2
'Sub TESTFootnoteParen()
'    Call FootnoteParen(Selection.Text, "csSuperscript", "({[", "]})")
'End Sub
End Function
Limit of Sixty Characters
As an aside, I noted that a recorded macro split the footnote text in what appears to be sixty-character chunks:-

Code: Select all

    Selection.TypeText Text:= _
        "NOT, I stress, me holding. I hold only my two favorite flavo"
    Selection.TypeText Text:="urs, ""Two litre"" and ""four litre"""
At first glance this ranks right up there with all the old predictions that folks would never need to store more than 64 files, that 9 entries suffices on the MRU list on a File menu, and that a MRU list of three is sufficient in the Windows Explorer search box.
I understand the “9”; an 80-column punched-card programmer would set aside a single byte location and store the value as a decimal digit character. None of this two-fifty-five nonsense!
But sixty?

Cheers
Chris
You do not have the required permissions to view the files attached to this post.
I’ve been tidying the junk out of my shed for five years, and now can hardly get into the shed

User avatar
HansV
Administrator
Posts: 78930
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Word2003 Footnotes - enhanced

Post by HansV »

The maximum line length in the VBE is 255. My guess is that 60 is for (a) readability - very long lines are hard to read - and (b) expandability - it is easy to edit a line and add some text, such as a comment, after recording a macro. If the lines were already near the limit, it would be harder to edit them.
Best wishes,
Hans