• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 79
  • Last Modified:

Footnotes and End Notes in Word Documet. Can I use both in one document and How?

Dell Inspirton, 1500 series. Windows 10.

I have a 1,000 page document with 800 footnotes. On completion of the work I want to display most of these footnotes as numbered  ENDNOTES. However I also want  to display some 150  of these notes as footnotes, not using numbers but asterisks etc  (*, **, *+).
Is the only way to do this by
1. Converting all 800 footnotes to endnotes.
2. Then deleting those notes which I want to display as footnotes (150).
3. Finally entering the deleted notes, one by one, into the text, placing first the symbol in the correct position and putting the reference content, at the bottom of each page.
(This would be laborious). Is there any other option?
0
Michael Murphy
Asked:
Michael Murphy
  • 2
1 Solution
 
Paul SauvéRetiredCommented:
yes - this can be done...
Footnotes and Endnotes
Tips, Tricks, and Answers
Converting Individual Endnotes and Footnotes
Word makes it easy to convert all your footnotes to endnotes and vice versa. You may want to only convert a couple of them, and the key to doing this is discussed in this tip.

Footnotes and Endnotes
Tips, Tricks, and Answers
0
 
Neil FlemingConsultant and developerCommented:
As Paul says, you can block convert, or individually convert footnotes to endnotes.

However, to do what you want to achieve easily, you may need some VBA code.

The attached sample file contains two VBA procedures.

The first converts all footnotes to endnotes, APART from any footnotes flagged to retain as footnotes. Footnotes are flagged by manually adding the meaningless characters "$$$" to the footnote.

The code cycles through each page in the document and converts any footnotes it finds which do not contain the characters "$$$" to endnotes.

It then recreates the remaining footnotes on each page with asterisks as their reference markers (footnote 1 gets *, footnote 2 gets **, etc)

Because of the oddities of Word's footnote function, the code actually deletes each footnote and re-inserts it with the relevant reference marker. It also deletes the $$$ flag.

Here is the code:

Sub ConvertFootNotes()
'converts all footnotes to endnotes
'APART from footnotes containing the marker text "$$$"
'These are converted to new footnotes using asterisks to count them on each page.

Dim dd As Document, pp As Page, r1 As Range, r2 As Range
Dim ss As Selection
Dim fn As Footnote
Dim iPage As Long, iPageCount As Long, iNote As Long, iStar As Long
Dim sRef As String, sText As String
Const Marker = "$$$"

Set dd = ActiveDocument
Set ss = Selection
iPageCount = dd.ActiveWindow.ActivePane.Pages.Count

    'cycle through pages
    For iPage = 1 To iPageCount
    If iPage < iPageCount Then
    'select whole page
    Set r1 = dd.GoTo(what:=wdGoToPage, which:=wdGoToAbsolute, Count:=iPage)
    r1.Select
    ss.GoTo what:=wdGoToBookmark, Name:="\Page"
    r1.End = ss.End - 1
    r1.Select
    'handle last page:
    Else
    ss.Start = ss.End + 1
    ss.EndKey wdStory, True
    End If
    
        'cycle backwards through all footnotes on page
        For iNote = ss.Footnotes.Count To 1 Step -1
        Set fn = Selection.Footnotes(iNote)
        'get footnote text
        sText = fn.Range.Text
        'get reference range
        Set r2 = fn.Reference
        
        'check for "keep as footnote" marker
            If InStr(sText, Marker) > 0 Then
            'if marker found, remove marker and convert reference to asterisks
            sText = Replace(sText, Marker, "")
            'create custom reference using asterisks
            sRef = ""
                For iStar = 1 To iNote
                sRef = sRef & "*"
                Next
            
            'delete old version of footnote
            fn.Delete
            'replace with asterisk-based footnote
            r2.Footnotes.Add r2, sRef, sText
            Else
            'no marker in footnote, delete footnote and insert as endnote
            fn.Delete
            dd.Endnotes.Add r2, , sText
            End If
        'next footnote
        Next
    'next page
    Next
    
'set endnotes numbering style
dd.Endnotes.NumberStyle = wdNoteNumberStyleArabic
End Sub

Open in new window


The second routine in the file converts all flagged endnotes to footnotes, but preserves the $$$ flagging, as follows:
Sub ConvertEnd2Foot()
'converts all endnotes to footnotes
Dim dd As Document, ee As Endnote
Dim iNote As Long
Dim sText As String
Const marker = "$$$"

Set dd = ActiveDocument

With dd.Endnotes
For iNote = .Count To 1 Step -1
Set ee = .Item(iNote)
sText = ee.Range.Text
    If InStr(sText, marker) Then
    dd.Footnotes.Add ee.Reference, , ee.Range.Text
    ee.Delete
    End If
Next
End With
'set footnotes numbering style
dd.Footnotes.NumberStyle = wdNoteNumberStyleArabic
End Sub

Open in new window


I think that enables you to manipulate foot- and end-notes at will.

For example, you can flag the footnotes directly in each page that you want to keep, and then run the ConvertFootNotes routine once.

Alternatively, you can convert all footnotes to endnotes, flag those endnotes you want to convert back into footnotes in a single place (document end) and then run Convert2End followed by ConvertFootNotes again.

This converts flagged endnotes into regular footnotes, numbered alphanumerically and still flagged $$$. The second use of ConvertFootNotes changes the numbering to asterisks and removes the $$$ flagging.

I strongly recommend testing these routines on a copy of your file before running the code, just to ensure they do what you want. It may be an idea, for instance, to tweak the code to keep the $$$ flag intact, and add a final procedure to remove it only once you are ready to finalise.

Hope this is what you were looking for.
footnote-conversion.docm
0
 
Michael MurphyAuthor Commented:
Brilliant. Thanks
0
 
Neil FlemingConsultant and developerCommented:
Michael -- just realised the code I wrote could create footnotes with strange numbers of stars.

If there are 4 footnotes and footnotes #4 and #1 are flagged to keep as footnotes, while the other two are to be moved to endnotes, you will wind up with **** and *.

So attached and below is a revised version of the code which separates the functions properly:
  • ConvertNotes(foot) is a dual purpose converter, which will convert footnotes to endnotes if passed a TRUE variable, and endnotes to footnotes if fed a FALSE
  • Foot2End() simply calls ConvertNotes(TRUE)
  • End2Foot() calls ConvertNotes(FALSE)
  • AsteriskFoot() turns footnotes into asterisks. The other functions no longer mess with the numbering format
  • DeFlag deletes the $$$ markers from both footnotes and endnotes. The other functions leave the flag intact

I think this is simpler to use, and safer

Here is the code:

Option Explicit

Sub foot2End()
ConvertNotes True
End Sub

Sub end2Foot()
ConvertNotes False
End Sub

Sub deFlag()
Dim dd As Document, nn As Object
Set dd = ActiveDocument
For Each nn In dd.Footnotes
nn.Range.Text = Replace(nn.Range.Text, "$$$", "")
Next

For Each nn In dd.Endnotes
nn.Range.Text = Replace(nn.Range.Text, "$$$", "")
Next
End Sub


Sub ConvertNotes(foot As Boolean)
'converts footnotes to endnotes and vice versa, based on value of foot2end:
Dim dd As Document, oSource As Object, oGoal As Object, nn As Object
Dim rr As Range
Dim iNote As Long
Dim sText As String
Const marker = "$$$"
Dim MoveIt As Boolean

Set dd = ActiveDocument

If foot Then
Set oSource = dd.Footnotes
Set oGoal = dd.Endnotes
Else
Set oSource = dd.Endnotes
Set oGoal = dd.Footnotes
End If

With oSource
For iNote = .Count To 1 Step -1
Set nn = .Item(iNote)
sText = nn.Range.Text
Set rr = nn.Reference
'move to footnotes if flagged and converting end 2 foot
'keep as footnote if flagged and converting foot 2 end:
    MoveIt = foot Xor (CBool(InStr(sText, marker)))
    If MoveIt Then
    nn.Delete
    oGoal.Add rr, , sText
    
    End If
Next
End With
'set numbering style
oGoal.NumberStyle = wdNoteNumberStyleArabic
End Sub



Sub AsteriskFoot()
'converts alphanumeric footnotes to asterisks
Dim dd As Document, r1 As Range, r2 As Range
Dim ss As Selection
Dim fn As Footnote
Dim iPage As Long, iPageCount As Long, iNote As Long, iStar As Long
Dim sRef As String, sText As String

Set dd = ActiveDocument
Set ss = Selection
iPageCount = dd.ActiveWindow.ActivePane.Pages.Count

    'cycle through pages
    For iPage = 1 To iPageCount
    If iPage < iPageCount Then
    'select whole page
    Set r1 = dd.GoTo(what:=wdGoToPage, which:=wdGoToAbsolute, Count:=iPage)
    r1.Select
    ss.GoTo what:=wdGoToBookmark, Name:="\Page"
    r1.End = ss.End - 1
    r1.Select
    'handle last page:
    Else
    ss.Start = ss.End + 1
    ss.EndKey wdStory, True
    End If
    
        'cycle backwards through all footnotes on page
        For iNote = ss.Footnotes.Count To 1 Step -1
        Set fn = Selection.Footnotes(iNote)
        'get footnote text
        sText = fn.Range.Text
        'get reference range
        Set r2 = fn.Reference
        
        'create custom reference using asterisks
        sRef = ""
            For iStar = 1 To iNote
            sRef = sRef & "*"
            Next
        'delete old version of footnote
        fn.Delete
        'replace with asterisk-based footnote
        r2.Footnotes.Add r2, sRef, sText
        'next footnote
        Next
    'next page
    Next
'collapse selection
ss.Collapse
End Sub

Open in new window


And the sample file is attached
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now