Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2025, 09:22 PM
gcp gcp is offline VBA Word Macro - remove superscript footnote ref Windows 11 VBA Word Macro - remove superscript footnote ref Office 2021
Novice
VBA Word Macro - remove superscript footnote ref
 
Join Date: Mar 2025
Posts: 17
gcp is on a distinguished road
Default Remove superscript footnote

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.
Reply With Quote
  #2  
Old 03-24-2025, 10:43 PM
macropod's Avatar
macropod macropod is offline VBA Word Macro - remove superscript footnote ref Windows 10 VBA Word Macro - remove superscript footnote ref Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by gcp View Post
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.
I tested it and it worked for me. Are your parentheses superscripted?

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
or even:
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
Avoid generative AI VBA code - it's frequently bug-ridden. Even Word's macro recorder would have done better in this instance.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-27-2025, 06:31 PM
gcp gcp is offline VBA Word Macro - remove superscript footnote ref Windows 11 VBA Word Macro - remove superscript footnote ref Office 2021
Novice
VBA Word Macro - remove superscript footnote ref
 
Join Date: Mar 2025
Posts: 17
gcp is on a distinguished road
Default

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.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Word Macro - remove superscript footnote ref Word Macro for removing parentheses around footnote numbers LLLCa947 Word VBA 6 11-21-2024 01:44 AM
VBA Word Macro - remove superscript footnote ref Convert superscript numbers to auto-footnote markers ra_beale Word VBA 4 09-05-2022 07:09 AM
VBA Word Macro - remove superscript footnote ref How to remove extra space between footnote separator and 1st footnote. No para breaks present. Swarup Word 2 07-09-2022 07:42 PM
VBA Word Macro - remove superscript footnote ref Macro to change font size of Footnote Reference in Footnote Text TheBigBoss Word VBA 5 06-10-2022 06:14 AM
VBA Word Macro - remove superscript footnote ref Footnote reference numbers precede by superscript '(' and follow w/ superscript ')' Swarup Word 4 07-18-2019 05:51 PM

Other Forums: Access Forums

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