#1
|
|||
|
|||
Preserving formatting when turning footnotes into regular text
Hi!
I'm using the following macro to turn footnotes into delimited fragments between "[!" and "!]" in the body of the text: Code:
Sub demo() Application.ScreenUpdating = False With ActiveDocument Do While .Footnotes.Count > 0 With .Footnotes(1) .Reference.InsertAfter "[!" & .Range.FormattedText & "!]" .Delete End With Loop End With Application.ScreenUpdating = True End Sub Is that something I could do to make the macro preserve the formatting? Thank's! Thiago |
#2
|
||||
|
||||
Try:
Code:
Sub Demo() Application.ScreenUpdating = False Dim Rng As Range With ActiveDocument Do While .Footnotes.Count > 0 With .Footnotes(1) Set Rng = .Reference With Rng .Collapse wdCollapseStart .Text = "[!!]" .Start = .Start + 2 .Collapse wdCollapseStart End With Rng.FormattedText = .Range.FormattedText .Delete End With Loop End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Excellent! Thank you!
|
Tags |
footnote, formatting |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing words with bold and italics and turning "regular" words into italicized and bold ones | thiagoafdoria | Word VBA | 4 | 12-02-2019 11:41 AM |
regular expressions in footnotes | loes | Word | 3 | 09-04-2019 07:52 AM |
Word Problems - text turning to gibberish | Dw1 | Word | 4 | 06-17-2015 01:07 PM |
Regular expressions for text with complex formatting | Kreol2013 | Word VBA | 1 | 04-12-2013 07:33 PM |
regular Expressions Formatting for Search | sesproul | Mail Merge | 1 | 11-30-2011 05:02 AM |