![]() |
|
|
|
#1
|
||||
|
||||
|
You don't even need a macro for that. A basic wildcard Find/Replace will do:
Find = \(*\) Replace = nothing where the Find format is specified as superscript.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Thanks Paul. I couldn't make that work as "Replace = nothing
where the Find format is specified as superscript" is beyond my abilities. In any event, my aim is to learn to write VBA macros. |
|
#3
|
||||
|
||||
|
Quote:
As a macro, the Find/Replace becomes: Code:
Sub DemoA() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Font.Superscript = True .Text = "\(*\)" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With Application.ScreenUpdating = True End Sub Code:
Sub DemoB() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Font.Superscript = True .Execute FindText:="\(*\)", ReplaceWith:="", MatchWildcards:=True, Format:=False, Forward:=True, Wrap:=wdFindContinue, Replace:=wdReplaceAll End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#4
|
|||
|
|||
|
Thanks Paul. DemoB() works. Some of the footnotes had square brackets, so I added that to the macro. Thanks for your help. Little by little I'm getting there.
|
|
#5
|
|||
|
|||
|
Thanks Paul (in Canberra). I selected "Find what: \(*\)". "Options: Use Wildcards". "Format: Superscript" but the result was "All done. We made 0 replacements"
In any event, my aim is to learn to write VBA macros so this task is to get me started. I'd be interested to know why the replace did not work, but I'm more interested in trying to learn VBA. gcp in Sydney |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word Macro for removing parentheses around footnote numbers
|
LLLCa947 | Word VBA | 6 | 11-21-2024 01:44 AM |
Convert superscript numbers to auto-footnote markers
|
ra_beale | Word VBA | 4 | 09-05-2022 07:09 AM |
How to remove extra space between footnote separator and 1st footnote. No para breaks present.
|
Swarup | Word | 2 | 07-09-2022 07:42 PM |
Macro to change font size of Footnote Reference in Footnote Text
|
TheBigBoss | Word VBA | 5 | 06-10-2022 06:14 AM |
Footnote reference numbers precede by superscript '(' and follow w/ superscript ')'
|
Swarup | Word | 4 | 07-18-2019 05:51 PM |