Yes Frosty, thank your for helping
after that thing with the commas, the next problem emerged
seems to be in an infinite loop
I'm stopping the macro after 1 minute running and no result, pressing ctrl + pause break, and when the macro stops, it highlights the line possibly problematic, and it its the line '.execute' inside the block 'With rngResult.Find'.
I'm gonna put the piece of block and write a comment (STOPS IN THIS LINE) to make it more clear
Function StripStyleKeepFormatting(ByRef sty As Style, _
ByRef doc As Document)
Dim rngToSearch As Range
Dim rngResult As Range
Dim f As Font
Set rngToSearch = doc.Range
Set rngResult = rngToSearch.Duplicate
Do
With rngResult.Find
.ClearFormatting
.Style = sty
.Text = ""
.Forward = True
.Wrap = wdFindStop
.Execute 'STOPS IN THIS LINE
End With
If Not rngResult.Find.Found Then Exit Do
Set f = rngResult.Font.Duplicate
With rngResult
.Font.Reset
.Font = f
.MoveStart wdWord
.End = rngToSearch.End
End With
Set f = Nothing
Loop Until Not rngResult.Find.Found
End Function