Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Print(string[] args)
- {
- Word.Application app = new Word.Application();
- Object fileName = AppDomain.CurrentDomain.BaseDirectory + "/docs/Поставка.docx";
- Object missing = Type.Missing;
- app.Documents.Open(ref fileName);
- Word.Find find = app.Selection.Find;
- find.Text = "Name_Tovar";
- find.Replacement.Text = "два";
- Object wrap = Word.WdFindWrap.wdFindContinue;
- Object replace = Word.WdReplace.wdReplaceAll;
- find.Execute(FindText: Type.Missing,
- MatchCase: false,
- MatchWholeWord: false,
- MatchWildcards: false,
- MatchSoundsLike: missing,
- MatchAllWordForms: false,
- Forward: true,
- Wrap: wrap,
- Format: false,
- ReplaceWith: missing, Replace: replace);
- app.ActiveDocument.Close();
- app.Quit();
- }
Add Comment
Please, Sign In to add comment