![]() |
|
#5
|
||||
|
||||
|
For the content you provided, this macro works
Code:
Sub Macro1()
Dim aRng As Range, aSty As Style
Set aRng = ActiveDocument.Range
Set aSty = ActiveDocument.Styles("Note Heading")
aSty.Font.Name = "Calibri"
aSty.Font.Size = 8
With aRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Style = aSty
.Text = "door type:"
.Replacement.Text = "Door Type:"
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = True
Do While .Execute(Replace:=wdReplaceOne)
aRng.Paragraphs(1).Range.Font.Reset
aRng.Collapse Direction:=wdCollapseEnd
Loop
End With
Set aRng = ActiveDocument.Range
With aRng.Find
.Text = "door material:"
.Replacement.Text = "^pDoor Material:"
.Execute Replace:=wdReplaceAll
End With
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sentence Template | michissimo | Word | 1 | 11-19-2020 05:53 PM |
VBA: Set two styles in one sentence
|
jeffreybrown | Word VBA | 6 | 09-07-2018 03:46 PM |
I want to know how to format a sentence after beginning it with an automatic number
|
spirituel | Word | 2 | 09-29-2015 01:50 AM |
End of sentence puncuation.
|
nrsmd | Word | 2 | 07-04-2015 10:33 PM |
Delete does not bring second sentence closer to first sentence
|
Andoheb | Word | 29 | 07-03-2014 01:48 PM |