VSTO ThisAddIn と Word 2013 を使用しています。
ある文字列のすべての発生を別の文字列に置き換え、Find.Execute
このアクションをカスタムの元に戻すメッセージでマークしたいと思います。コードは次のとおりです。
application.UndoRecord.StartCustomRecord("Some Message");
var find = application.ActiveDocument.Content.Find;
find.Execute("string to be replaced"
, ReplaceWith: "second string"
, Replace: WdReplace.wdReplaceAll);
application.EndCustomRecord();
そのため、このコードの実行中に Word クラッシュが発生しました。に変更Replace: WdReplace.wdReplaceAll
するとReplace: WdReplace.wdReplaceOne
、単語が機能しますが、すべての出現箇所を置き換える必要があります。
提案/回避策はありますか?