I need Find and Replace Macro

T

Thejan Mendis

Hi


I hope somebody can help me to make a word macro that replace all the curly
"" quotations to box like quotation marks and less than and grater than
(<> ) to (&lt; &gt;).


Plesssssss I need this very much


THEJAN
 
L

Larry

Sub StraightQuotesApply()
' by Larry

' Turns off smart quote feature if it's on, then replaces quotes by
quotes.
' Also replaces smart single quotes by straight single quotes.

If Options.AutoFormatAsYouTypeReplaceQuotes = True Then _
Options.AutoFormatAsYouTypeReplaceQuotes = False

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute replace:=wdReplaceAll

' replace "smart" apostophes with straight apostrophes
With Selection.Find
.Text = "[‘’]"
.Replacement.Text = "'"
.Forward = True
.MatchWildcards = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute replace:=wdReplaceAll

' clear Find
With Selection.Find
..MatchWildcards = False
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top