Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 11-05-2017, 12:58 PM
ballpoint ballpoint is offline Loop Through all documents in a folder Windows 10 Loop Through all documents in a folder Office 2016
Advanced Beginner
Loop Through all documents in a folder
 
Join Date: Sep 2017
Posts: 40
ballpoint is on a distinguished road
Default

You are absolutely correct, sorry for the omission.

Here is the code:

Code:
Sub foot2inline()
Dim oFeets As Footnotes
Dim oFoot As Footnote
Dim oRange As Range
Dim szFootNoteText As String
Dim index As Long

' Grabs the collection of FootNotes
Set oFeets = ActiveDocument.Footnotes

' Iterates through each footnote
For Each oFoot In oFeets
    index = index + 1
    szFootNoteText = oFoot.Range.Text
    
    'Start search from beginning of document
    Set oRange = ActiveDocument.Range
      
    With oRange.Find
        .Text = "^f" ' Looks for all footnotes
        .Forward = True
        .Wrap = wdFindStop
        .Execute
    End With
    
    ' Delete the footnote
    oFoot.Delete
    
    'Insert the footnote text
    oRange.Text = " [Note " & index & ": " & szFootNoteText & "] "

    'CHANGE COLOR HERE. Color code is below.
    'oRange.Font.Color = 6299648

    'Disables undo to save memory on very large documents.
    'ActiveDocument.UndoClear
Next
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop Through all documents in a folder How to open Documents folder directly from CTRL+O of Open folder on QAT scvjudy Word 2 08-11-2014 10:58 PM
Loop Through all documents in a folder Content of all documents in folder changes to match one of them jemmac2525 Word 2 11-11-2013 12:32 AM
Office 2010 Can't Open Or Save Documents in My Documents Folder trippb Office 1 07-12-2013 07:29 AM
Loop Through all documents in a folder Documents saved to wrong folder stevecarr Word 1 09-22-2011 05:32 AM
Loop through folder of workbooks and copy range to other workbook Snvlsfoal Excel Programming 3 07-29-2011 05:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:10 AM.


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