View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Find/Replace MSWord wildcard characters from within Excel

Excel 2003, Windows XP

This code, based in an Excel workbook, retrieves words from Microsoft Word (Word 2003). But first it strips out all punctuation. I'm having trouble stripping out the wildcard characters.

This is the code fragment not working:

Set oRange = ActiveDocument.Range
With oRange.Find
.Text = "?"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
End With
oRange.Find.Execute Replace:=wdReplaceAll


I've tried replacing
.Text = "?"
with
.Text = "/?"

which is the MSWord signal to look for the actual character mark, and

.Text = "~?"

which is the Excel signal to look for the actual character mark, but neither works.

Any ideas? I also need this to find the MSWord wildcard characters ! and *.

Thank you!
Susan