Einzelnen Beitrag anzeigen
Alt 18.07.2004, 16:27   #10
Kasparov
Veteran
 
Registriert seit: 07.07.2002
Ort: Wien
Alter: 52
Beiträge: 251


Idee danke danke danke

@flinx:

hat zwar so nicht gefunkt, aber ohne deine Hilfe wär ich da in 1000 Jahren nicht draufgekommen. DANKE !!!!

Hab das mal geändert in:

Sub Schach()
ActiveDocument.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[R,Q,N,B]?[1-8]"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
While Selection.Find.Execute
Selection.Text = Replace(Selection.Text, "R", "T", 1, 1)
Selection.Text = Replace(Selection.Text, "Q", "D", 1, 1)
Selection.Text = Replace(Selection.Text, "N", "S", 1, 1)
Selection.Text = Replace(Selection.Text, "B", "L", 1, 1)
Wend
ActiveDocument.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[R,Q,N,B]??[1-8]"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
While Selection.Find.Execute
Selection.Text = Replace(Selection.Text, "R", "T", 1, 1)
Selection.Text = Replace(Selection.Text, "Q", "D", 1, 1)
Selection.Text = Replace(Selection.Text, "N", "S", 1, 1)
Selection.Text = Replace(Selection.Text, "B", "L", 1, 1)
Wend
End Sub


... und das funkt erstklassig!
Einziger Nachteil: es ist irre langsam - woran liegt das?
Und außerdem: kann man auch gleichzeitig nach zwei Texten suchen:
.Text = "[R,Q,N,B]?[1-8]" UND
.Text = "[R,Q,N,B]??[1-8]"
... ist ja sonst das gleiche. Oder brauch ich da die ganze Wurst ein zweites Mal?

Nochmals vielen Dank!!!
____________________________________
***************************************
Schnell muß er nicht sein, aber stabil!
Kasparov ist offline   Mit Zitat antworten