![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
How to convert text inside parenthesis scattered in a word document into numbered footnotes or endnotes? |
|
#2
|
|||
|
|||
|
How many are we talking about?
Is there any text inside parentheses that is not to be a footnote? For me, at least, this would be a big project. |
|
#3
|
|||
|
|||
|
How many are we talking about?
100-150 4-5 per page in a 30-page doc Is there any text inside parentheses that is not to be a footnote? No For me, at least, this would be a big project. For me too, as I have a dozen docs like this to process, and I would hate to have to di it manually. |
|
#4
|
||||
|
||||
|
The following macro will convert your 'text inside parenthesis' to footnotes.
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Rng As Range, FtNt As Footnote
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\([!\(]@\)"
.Replacement.Text = ""
.Forward = True
.Format = True
.Wrap = wdFindStop
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
Set Rng = .Duplicate
Rng.Characters.First.Delete
Rng.Characters.Last.Delete
.Collapse wdCollapseStart
Set FtNt = .Footnotes.Add(.Duplicate)
Rng.Start = FtNt.Reference.End
FtNt.Range.FormattedText = Rng.FormattedText
Rng.Delete
If .End = ActiveDocument.Range.End Then Exit Sub
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#5
|
|||
|
|||
|
Paul, thank you so much. I'll put it to work today and I will let you know.
|
|
#6
|
|||
|
|||
|
Beautiful! It works. So cool. Thank you again, Paul.
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Convert particular blocks of text within a word document to tables using macro
|
benbob | Word VBA | 5 | 07-15-2018 03:20 AM |
| Text inside text boxes create headings inside my table of contents!!! How do I delete the created he | carstj | Word | 3 | 04-11-2016 12:46 PM |
| Convert manual cross references in footnotes to other footnotes to automatic cross references | ghumdinger | Word VBA | 7 | 11-20-2014 11:47 PM |
convert numbered list to regular text
|
Cobb78 | Word | 1 | 05-26-2012 05:09 PM |
I don t want the footnotes to be numbered continiously in all pages
|
mj2000 | Word | 1 | 10-24-2011 12:43 PM |