Guest User

Untitled

a guest
Feb 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. static void Print(string[] args)
  2. {
  3. Word.Application app = new Word.Application();
  4. Object fileName = AppDomain.CurrentDomain.BaseDirectory + "/docs/Поставка.docx";
  5. Object missing = Type.Missing;
  6. app.Documents.Open(ref fileName);
  7. Word.Find find = app.Selection.Find;
  8. find.Text = "Name_Tovar";
  9. find.Replacement.Text = "два";
  10. Object wrap = Word.WdFindWrap.wdFindContinue;
  11. Object replace = Word.WdReplace.wdReplaceAll;
  12. find.Execute(FindText: Type.Missing,
  13. MatchCase: false,
  14. MatchWholeWord: false,
  15. MatchWildcards: false,
  16. MatchSoundsLike: missing,
  17. MatchAllWordForms: false,
  18. Forward: true,
  19. Wrap: wrap,
  20. Format: false,
  21. ReplaceWith: missing, Replace: replace);
  22. app.ActiveDocument.Close();
  23. app.Quit();
  24. }
Add Comment
Please, Sign In to add comment