Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2023, 01:13 AM
WJSwanepoel WJSwanepoel is offline Correct footnore references Windows 10 Correct footnore references Office 2021
Advanced Beginner
Correct footnore references
 
Join Date: Dec 2019
Location: Krugersdorp, South Africa
Posts: 65
WJSwanepoel is on a distinguished road
Default Correct footnore references

I have a document where the original author added a close bracket after every footnote reference, eg. 1), the 1 Superscript, the ) non-superscript.



I want to remove the close bracket, but none of my replace statements want to work.
([0-9])\) (wildcards) does not pick it up, only picks up non-superscript occurrences.

How can this be done?
Reply With Quote
  #2  
Old 07-10-2023, 04:55 PM
Guessed's Avatar
Guessed Guessed is offline Correct footnore references Windows 10 Correct footnore references Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I tried searching for "^f" which is a footnote reference but that won't work with wildcards so it may require some lateral thinking to do as a simple find and replace.

Since you are using VBA you might as well do the non-wildcard search and then work on that.
Code:
Sub FootnoteBracketsBegone()
  Dim aRng As Range
  Set aRng = ActiveDocument.Range
  With aRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^f)"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    Do While .Execute = True
      If aRng.Characters.Last = ")" Then aRng.Characters.Last.Delete
      aRng.End = ActiveDocument.Range.End
    Loop
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 07-19-2023, 12:05 AM
WJSwanepoel WJSwanepoel is offline Correct footnore references Windows 10 Correct footnore references Office 2021
Advanced Beginner
Correct footnore references
 
Join Date: Dec 2019
Location: Krugersdorp, South Africa
Posts: 65
WJSwanepoel is on a distinguished road
Default Footnote References

Good day Andrew,
Thank you for your response. I tried the VBA you suggested but it is extremely slow.
Also it removes the bracket in the text but not in the footnote itself.
Reply With Quote
Reply

Tags
footnote



Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct footnore references The correct formula wheddingsjr Excel 4 05-02-2023 09:19 AM
Convert manual cross references in footnotes to other footnotes to automatic cross references ghumdinger Word VBA 7 11-20-2014 11:47 PM
Correct footnore references Auto Correct RodneyJ Word 12 11-06-2014 06:17 AM
Which .pst is the correct .pst dbsoccer Outlook 1 04-08-2012 12:12 PM
So what is the correct value of PONT_STRING anyway? DrDOS Outlook 0 11-21-2010 04:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft