View Single Post
 
Old 06-04-2023, 07:00 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Need help with a script with Selection and If for Font Size < 8?

I feel I'm so close but searching doesn't come up with solution

I have
Code:
Sub TESTS_If_Font_size_below_8p5_put_Font_size_8p5()
Dim Rng As Range

With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Execute
  End With
   Do While .Find.found = True
      If .Font.Size < 8.5 Then

           .Find.Replacement.Font.Size = 8.5
           
      End If
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
End Sub
Why it does nothing? No error message but no action

Need advice please

Unless it's not doable? I keep searching.

C
Reply With Quote