

Ref matchKashida, ref matchDiacritics, ref matchAlefHamza, ref matchControl) Īnd SequentialReplaceToken being a string constant that is known to never come up in the document. Ref matchWildCards, ref matchSoundsLike, ref matchAllWordForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace, Like so: private void FindAndReplace(Application doc, object findText, object replaceWithText)ĭoc.(ref findText, ref matchCase, ref matchWholeWord, Var firstTwent圜hars = restOfText.Substring(0, 20) įirstTwent圜hars += SequentialReplaceToken įindAndReplace(word, SequentialReplaceToken, firstTwent圜hars) įindAndReplace(word, SequentialReplaceToken, restOfText) įindAndReplace(.) being a wrapper over the Word interop Function. FindAndReplace(word, replacementKey, SequentialReplaceToken) You could do something like this of you really must do it this way. I recognize that this is a year old but since the technical side of the question never got answered I figured I take the time to post this for who ever stumbles upon it. Ref wrap, ref format, ref replaceWithText,īut in here if the "replaceWithText" too lone there is error and it says String parameter too long. In the Replace With box, type the replacement.

To replace found text: Select the magnifying glass, and then select Replace.

private void FindAndReplace(.Application WordApp, object findText, object replaceWithText) In the upper-right corner of the document, in the search box, type the word or phrase that you want to find, and Word will highlight all instances of the word or phrase throughout the document. So this is my code for replace word document variables. I want to create a world document using C#.
