Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 03-22-2021, 11:38 AM
RiSta RiSta is offline Footnote extraction macro [Why is this macro so slow? /  anyway to make it faster?] Windows 10 Footnote extraction macro [Why is this macro so slow? /  anyway to make it faster?] Office 2019
Novice
 
Join Date: Jun 2020
Posts: 7
RiSta is on a distinguished road
Default

Hello

Facing one problem with this macro - in some cases, after moving a footnote to a new position, footnote text accepts destination formatting. It happens when footnote text contains few lines devided by paragraph mark. Is it possible to modify macro so that is preserves footnotes original format.

Code:
Sub MoveFootNotes()
Application.ScreenUpdating = False
Dim RngSrc As Range, RngTgt As Range, f As Long
With ActiveDocument
  For f = .Footnotes.Count To 1 Step -1
    With .Footnotes(f)
      Set RngSrc = .Range
      Set RngTgt = .Reference
      RngSrc.End = RngSrc.End
      With RngTgt
        .Collapse wdCollapseStart
        .FormattedText = RngSrc.FormattedText
        .InsertBefore " ###"
        .Collapse wdCollapseEnd
        .InsertAfter "###"
        .Font.Reset
      End With
      .Delete
    End With
  Next
End With
Set RngSrc = Nothing: Set RngTgt = Nothing
Application.ScreenUpdating = True
End Sub

Last edited by macropod; 03-22-2021 at 01:56 PM. Reason: Added code tags
Reply With Quote
 

Tags
footnotes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make macro available to all PPT presentations djlee PowerPoint 2 02-11-2015 12:52 PM
Footnote extraction macro [Why is this macro so slow? /  anyway to make it faster?] Help make Macro Please ddaniels Word VBA 1 01-13-2015 05:36 PM
Footnote extraction macro [Why is this macro so slow? /  anyway to make it faster?] VBA code for Microsoft Word macro — select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
Macro to find text only footnote numbers TimFromPhx Word VBA 7 04-10-2014 07:05 PM
Footnote extraction macro [Why is this macro so slow? /  anyway to make it faster?] How to make an add-in/global macro hanvyj Excel Programming 4 12-14-2012 03:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:39 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