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

Re: Can the (") delimiter be changed to another character? by Helmut

Helmut
Tue May 10 07:37:54 CDT 2005

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.



>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
>


Re: Can the (") delimiter be changed to another character? by Helmut

Helmut
Tue May 10 07:42:41 CDT 2005

Oops,
I'm ashamed,
I hit the wrong button.

Helmut Weber