1 2 3 4 5 6 7 8 9 10 11 12 13 14
| string FindText= "£TEL"
string ReplaceText ="99.88.77.66.55" ;
object FindTextObject = FindText ;
object ReplaceTextObject = ReplaceText ;
object MissingObject = System.Reflection.Missing.Value ;
object ReplaceObject = 2 ; // 2=ReplaceAll
Word.Range DocRange=MyWordDocument.Range(ref MissingObject,ref MissingObject) ;
DocRange.Select() ;
DocRange.Find.Execute(
ref FindTextObject , ref MissingObject, ref TrueObject , // FindText , Matchcase , WholeWord
ref MissingObject , ref MissingObject, ref MissingObject , // WildCard , MatchSoundsLike, MatchAllWordsForm
ref TrueObject , ref MissingObject, ref MissingObject , // Forward , Wrap , Format
ref ReplaceTextObject, ref ReplaceObject, ref MissingObject , // ReplaceWith , Replace , MatchKasida
ref TrueObject , ref MissingObject, ref MissingObject); // MatchDiacritics,MatchAlefHamza , MatchControl |
Partager