Share via

macro delete between brackets

Anonymous
2012-04-09T07:57:46+00:00

this macro no longer works.  i swear it was working a moment ago

Sub DeleteBetween()

  With ActiveDocument.Content.Find

    .Text = "[*]"

    .Replacement.Text = ""

    .ClearFormatting

    .Replacement.ClearFormatting

    .MatchWildcards = False

    .Execute Replace:=wdReplaceAll

  End With

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2012-04-09T09:24:16+00:00

You must use

          .MatchWildcards:=True

since the search string contains a wildcard *.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-04-09T10:21:45+00:00

    I tried that and nothing happened.  this time when i tried it it worked.  thanks

    Was this answer helpful?

    0 comments No comments