Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-19-2022, 06:19 AM
gmaxey gmaxey is offline Extract all footnotes and add them to a customized table Windows 10 Extract all footnotes and add them to a customized table Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

I was working on this before I had to leave for a short trip yesterday. Was thinking along the same lines as Paul - and not that it makes a big difference - but was wanting to avoid the two loops. Here is my version:

Code:
Sub ListFootnotes()
Dim oDoc As Document, oDocTbl As Document
Dim oTbl As Table
Dim oRng As Range
Dim lngIndex As Long
  Application.ScreenUpdating = False
  Set oDoc = ActiveDocument: Set oDocTbl = Documents.Add
   With oDocTbl
    Set oTbl = .Tables.Add(Range:=.Range, Numrows:=3, NumColumns:=2, DefaultTableBehavior:=wdWord9TableBehavior)
    oTbl.Columns(1).Cells.Merge
    Set oRng = oTbl.Range.Duplicate
     For lngIndex = 1 To oDoc.Footnotes.Count
      With oTbl
        .Cell(.Range.Information(wdEndOfRangeRowNumber) - 2, 1).Range.Text = lngIndex
        .Cell(.Range.Information(wdEndOfRangeRowNumber) - 2, 2).Range.Text = "Original:" & vbCr & oDoc.Footnotes(lngIndex).Range.FormattedText
        .Cell(.Range.Information(wdEndOfRangeRowNumber) - 1, 2).Range.Text = "Copy 1:" & vbCr & oDoc.Footnotes(lngIndex).Range.FormattedText
        .Cell(.Range.Information(wdEndOfRangeRowNumber), 2).Range.Text = "Copy 2:" & vbCr & oDoc.Footnotes(lngIndex).Range.FormattedText
      End With
      If lngIndex < oDoc.Footnotes.Count Then .Range.Characters.Last.FormattedText = oRng.FormattedText
    Next
  End With
  Application.ScreenUpdating = True
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
extract, footnotes, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract all footnotes and add them to a customized table Extract words which has superscripts and the corresponding superscript value in footnotes in word sai Word VBA 12 05-11-2020 04:29 AM
Extract all footnotes and add them to a customized table How to add footnotes below the table ad.dias Word Tables 6 08-27-2017 02:42 PM
Extract all footnotes and add them to a customized table Create footnotes from table... ¿AUTOMATICALLY? jbaranao Word 3 02-08-2015 08:57 PM
Extract duplicates in table goran.c Excel 0 01-21-2015 12:47 AM
automatically extract footnotes into new file and apply character format to footnote hrdwa Word 0 02-27-2010 03:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft