Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FormatarMaterialJuridico()
- Dim rng As Range
- Set rng = ActiveDocument.Content
- Application.ScreenUpdating = False
- With rng.Find
- .ClearFormatting
- .Replacement.ClearFormatting
- ' Procura pelo padrão [V]texto[/V] usando caracteres curinga
- .Text = "\[V\](*)\[/V\]"
- .Replacement.Text = "\1"
- .MatchWildcards = True
- .Forward = True
- .Wrap = wdFindContinue
- ' Aplica a formatação exata do seu padrão visual
- .Replacement.Font.Color = RGB(255, 0, 0) ' Cor Vermelha
- .Replacement.Font.Underline = wdUnderlineSingle ' Sublinhado
- ' Executa a substituição em todo o documento de uma vez só
- .Execute Replace:=wdReplaceAll
- End With
- Application.ScreenUpdating = True
- MsgBox "Seu material foi formatado com sucesso!", vbInformation, "Automação Concluída"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment