Changes all bold formatting in the open document named Example.doc to italic formatting. : Documents « Word « VBA / Excel / Access / Word






Changes all bold formatting in the open document named Example.doc to italic formatting.

 
Sub change()
  With Documents("Example.doc").Content.Find
      .ClearFormatting
      .Font.Bold = True
      With .Replacement
          .ClearFormatting
          .Font.Bold = False
          .Font.Italic = True
      End With
      .Execute FindText:="A", ReplaceWith:="B", _
          Format:=True, replace:=wdReplaceAll
  End With
End Sub

 








Related examples in the same category

1.Loop through the Documents
2.To maximize, minimize, or "restore" a window, set its WindowState property to wdWindowStateMaximize, wdWindowStateMinimize, or wdWindowStateNormal, respectively
3.Check the current document count