View Single Post
 
Old 01-14-2025, 01:45 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

As Paul suggested, this is not simple if the figure numbers and/or letters are fields (and they should be either seq or ref fields) but as you wrote the examples showing just text here is a possible solution that doesn't go for the bonus points.
Code:
  With ActiveDocument.Content.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Font.AllCaps = True
    .Text = "FIG[.sS]{1,2} [1-9]{1,}[a-z]"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchKashida = False
    .MatchDiacritics = False
    .MatchAlefHamza = False
    .MatchControl = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote