名前空間document.Active()
の一部であるメソッドを使用しています。Microsoft.office.interop.word
ファイルを開きたい、つまり、Word アプリケーションで開いたファイルを確認したい。私はthetrackRevisions
プロパティをtrueに設定し、残りのすべてのものを設定しました。
名前を付けて保存モードではなく、ファイルを開きたいだけです。DB や PC ドライブからドキュメントを開くときに、ただ開いてほしいだけです。
私が実行しているコードは次のとおりです。
Word.Document tempDoc = app.Documents.Open("E:\\xyz.docx");
// Activate the document so it shows up in front
tempDoc.Activate();
tempDoc.TrackRevisions = true;
foreach (Revision rev in tempDoc.Revisions)
{
string editedBy = rev.Author;
//string what = rev.Cells;
}
tempDoc.Close(ref Nothing, ref format, ref Nothing);
心に浮かぶ提案はありますか?