noHandlebars
Technical User
I am running a macro that finds a section of text, deletes that section, then inserts new text. The new text needs to be formatted in a special way like horizontally centered and bolded and underlined for specific words. Is there anyway to code the formatting in?
Here's what I have so far:
With ActiveDocument.Content
.Find.Execute FindText:="Section C.3"
TextStart = .Start
.Collapse wdCollapseEnd
.Find.Execute FindText:="Section C.5B:"
.Collapse wdCollapseStart
.Start = TextStart
.Delete
'.InsertBreak wdPageBreak
‘consecutive needs to be underlined and italicized
.InsertAfter "The following consecutive sections from the questionnaire have
been removed because they are not relevant to facility operations:"
‘need blank lines inserted wherever .InsertAfter “” are located
.InsertAfter ""
.InsertAfter ""
.InsertAfter ""
‘all the section headings to be in bold
.InsertAfter "SECTION C.3: UNIT DESIGN RECYCLING/TREATMENT"
.InsertAfter ""
.InsertAfter "SECTION C.4: UNIT DESIGN – THERMAL
TREATMENT/INCINERATOR"
.InsertAfter ""
.InsertAfter "SECTION C.5A: UNIT DESIGN - LANDFILLS"
.InsertParagraphAfter
.Collapse wdCollapseEnd
.InsertBreak wdPageBreak
End With
Here's what I have so far:
With ActiveDocument.Content
.Find.Execute FindText:="Section C.3"
TextStart = .Start
.Collapse wdCollapseEnd
.Find.Execute FindText:="Section C.5B:"
.Collapse wdCollapseStart
.Start = TextStart
.Delete
'.InsertBreak wdPageBreak
‘consecutive needs to be underlined and italicized
.InsertAfter "The following consecutive sections from the questionnaire have
been removed because they are not relevant to facility operations:"
‘need blank lines inserted wherever .InsertAfter “” are located
.InsertAfter ""
.InsertAfter ""
.InsertAfter ""
‘all the section headings to be in bold
.InsertAfter "SECTION C.3: UNIT DESIGN RECYCLING/TREATMENT"
.InsertAfter ""
.InsertAfter "SECTION C.4: UNIT DESIGN – THERMAL
TREATMENT/INCINERATOR"
.InsertAfter ""
.InsertAfter "SECTION C.5A: UNIT DESIGN - LANDFILLS"
.InsertParagraphAfter
.Collapse wdCollapseEnd
.InsertBreak wdPageBreak
End With