View Single Post
 
Old 11-21-2023, 04:21 PM
Guessed's Avatar
Guessed Guessed is online now Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote