Can the (") delimiter be changed to another character?

J

John Svendsen

Hi,

I have the need to replace many pairs of strings that have the (") in them.
These pairs of strings are read from a file. Listed below is part of my
code:

=========================================
Open "myfile.txt" For Input As #1
Do While Not EOF(1)
Input #1, sFirst, sLast
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = sFirst
.Replacement.Text = sLast
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Loop
Close #1
=========================================

Is it possible to change the (") delimiter character in Word/VBA - to, let's
say - (¬) or (¢) ?

Or, does anybody have a better idea?

Thanks so much for your help.

JS
 
H

Helmut Weber

Hi John,
I'd replace " e.g. by chr(5) in the word file,
replace " by chr(5) in the input file,
Replace
depends on the structure of your input file.
Theoretically solvable, in endless time.

You may use chr$(5) as delimiter,
and line input to get really all characters.
 

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