View Single Post
 
Old 10-07-2013, 04:00 PM
slaycock slaycock is offline Windows 7 64bit Office 2013
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

Hi Macropod

The problem is that I want to implement the find and replace as part of a macro that processes a number of documents.

The square symbol has the Ascw value of 12288 (Hex 3000). If I search and replace using a .find.text string of "^u12288" then I replace not only the square symbol but also each and every space character in the document.

With ActiveDocument.StoryRanges(wdMainTextStory).Find
.ClearFormatting
.Replacement.ClearFormatting

.Text = "^u12288"
.Replacement.Text = vbtab

.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With

If I follow your advice of cutting and pasting into a manual search and replace then the same thing happens. All space characters are converted to tab characters.

Finally, would you be kind enough to explain the following line in your macro

.Text = "[" & ChrW(61472) & "-" & ChrW(61695) & "]"

What are the chrw(61472) and chrw(61695) and do I need to replace the - with my character e.g. ^u12288.

I'm really grateful for your input so far
Reply With Quote