, , , , , , - .
- , .
FindAndReplace(word, replacementKey, SequentialReplaceToken);
var restOfText = replaceWithText;
while (restOfText.Length > 20)
{
var firstTwentyChars = restOfText.Substring(0, 20);
firstTwentyChars += SequentialReplaceToken;
restOfText = restOfText.Substring(20);
FindAndReplace(word, SequentialReplaceToken, firstTwentyChars);
}
FindAndReplace(word, SequentialReplaceToken, restOfText);
FindAndReplace (...) Word.
:
private void FindAndReplace(Application doc, object findText, object replaceWithText)
{
object matchCase = false;
object matchWholeWord = true;
object matchWildCards = false;
object matchSoundsLike = false;
object matchAllWordForms = false;
object forward = true;
object format = false;
object matchKashida = false;
object matchDiacritics = false;
object matchAlefHamza = false;
object matchControl = false;
object read_only = false;
object visible = true;
object replace = 2;
object wrap = 1;
doc.Selection.Find.ClearFormatting();
doc.Selection.Find.Execute(ref findText, ref matchCase, ref matchWholeWord,
ref matchWildCards, ref matchSoundsLike, ref matchAllWordForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace,
ref matchKashida, ref matchDiacritics, ref matchAlefHamza, ref matchControl);
}
SequentialReplaceToken , , , .