79759990

Date: 2025-09-09 14:46:19
Score: 2
Natty:
Report link

Sorry - cut off...

So, how do I combine that content with the following? Not really understanding if there's a prefix and a suffix that I can put into the macro that I have? or is there a way that I can point to the Macro that only does an open page:

Sub CleanUpFormatting()
 
    Dim rng As Range
   
    '--- Step 1: Remove all text with strikethrough ---
    Set rng = ActiveDocument.Content
    With rng.Find
        .ClearFormatting
        .Font.StrikeThrough = True
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        Do While .Execute
            rng.Delete
        Loop
    End With
   
    '--- Step 2: Change red text to black ---
    Set rng = ActiveDocument.Content
    With rng.Find
        .ClearFormatting
        .Font.Color = wdColorRed
        .Replacement.ClearFormatting
        .Replacement.Font.Color = wdColorBlack
        .Text = ""
        .Replacement.Text = "^&" ' keeps the text itself
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
    End With
   
    MsgBox "Strikethrough text removed and red text changed to black.", vbInformation
 
End Sub

Reasons:
  • Blacklisted phrase (1): how do I
  • Blacklisted phrase (1): is there a way
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: bamGFX