Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cant get Word97 Replace All to work
Message
De
28/01/1999 11:30:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00181347
Message ID:
00181359
Vues:
9
>The VB script code that I captured looks like this:
>
> Selection.HomeKey Unit:=wdStory
> Selection.Find.ClearFormatting
> Selection.Find.Replacement.ClearFormatting
> With Selection.Find
> .Text = "#$@"
> .Replacement.Text = " 13"
> .Forward = True
> .Wrap = wdFindContinue
> .Format = False
> .MatchCase = False
> .MatchWholeWord = False
> .MatchWildcards = False
> .MatchSoundsLike = False
> .MatchAllWordForms = False
> End With
> Selection.Find.Execute Replace:=wdReplaceAll
>
>I generated the following VFP code for it (Where loWord is the Word object and I have the Word97 constants (wdStory,etc) as a .h file):
>
>loWord.SELECTION.HomeKey(wdStory)
>loWord.SELECTION.FIND.ClearFormatting
>loWord.SELECTION.FIND.Replacement.ClearFormatting
>loReplace = loWord.SELECTION.FIND
>WITH loReplace
>.TEXT = "#$@"
>.Replacement.TEXT = '13'
>.Forward = .T.
>.WRAP = wdFindContinue
>.FORMAT = .F.
>.MatchCase = .F.
>.MatchWholeWord = .F.
>.MatchWildcards = .F.
>.MatchSoundsLike = .F.
>.MatchAllWordForms = .F.
>ENDWITH
>loReplace.Execute(wdReplaceAll)
>
>But the replace all is not being done, can anyone give me a clue as to what I did wrong. The code does not error in VFP, if finishes OK, but the '#$@' is not getting replaced.
>
>TIA
Brett,
You could use the dialog.
#define wdDialogEditReplace 117
with .dialogs(wdDialogEditReplace)
	.Find = "#$@"
	.Replace = "13" && If you mean chr(13) then "^p"
	.MatchCase = .f.
	.ReplaceAll = .t.
	.Execute
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform