M
MichaelB
Hello,
I have the below Marco which will reformat a selected section of text,
clearing the format and then implementing new formatting. This works fine but
I am finding that I have tens of thousands of modifications within one
document that must be made. Is it possible to have this macro search for a
desired string of text (like “Justification:â€), then automatically select the
string and following text to the next hard return (¶) and then perform the
reformatting options? It would be nice to automate this process for going
through 589 pages searching for this is getting very tedious.
Any help would be greatly appreciated.
Mike
Sub fix_Paragraph1_Font_Bold()
'
' Macro to clear all formatting on selected text and then re-implement the
‘ proper paragraph 1 style with the first section (up to the “:â€) being set to
‘ paragraph 1 + Bold Font
'
Selection.ClearFormatting
Selection.ClearFormatting
Selection.Style = ActiveDocument.Styles("Paragraph 1")
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*:"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Font.Bold = wdToggle
Selection.HomeKey Unit:=wdLine
End Sub
I have the below Marco which will reformat a selected section of text,
clearing the format and then implementing new formatting. This works fine but
I am finding that I have tens of thousands of modifications within one
document that must be made. Is it possible to have this macro search for a
desired string of text (like “Justification:â€), then automatically select the
string and following text to the next hard return (¶) and then perform the
reformatting options? It would be nice to automate this process for going
through 589 pages searching for this is getting very tedious.
Any help would be greatly appreciated.
Mike
Sub fix_Paragraph1_Font_Bold()
'
' Macro to clear all formatting on selected text and then re-implement the
‘ proper paragraph 1 style with the first section (up to the “:â€) being set to
‘ paragraph 1 + Bold Font
'
Selection.ClearFormatting
Selection.ClearFormatting
Selection.Style = ActiveDocument.Styles("Paragraph 1")
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "*:"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Font.Bold = wdToggle
Selection.HomeKey Unit:=wdLine
End Sub