Odd behavior in Find.Execute code

E

Ed

I want to find doubled double quotes and replace with single double quotes
(change ""hi"" to "hi"). But my code is acting odd. I've got:
rngWork.Find.Execute FindText:="""", _
ReplaceWith:=""", Replace:=wdReplaceAll"

Noticce the double quote after ReplaceAll - the VBE puts that there! I
suspect it thinks that's the end of my ReplaceWith text string? How can I
write this to get around this problem?

Ed
 
P

Peter Hewett

Hi Ed

To quote one set of double quotes "", use six consecutive double quote characters!
Debug.Print """"""

prints:

""

HTH + Cheers - Peter
 

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