Microsoft.Office.Interop.Word.ApplicationClass msDoc = new Microsoft.Office.Interop.Word.ApplicationClass();
msDoc.Visible = false;
msDoc.Application.Visible = false;
msDoc.Documents.Open(ref docPath, ref UNKNOWN,
ref READ_ONLY, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN, ref UNKNOWN, ref UNKNOWN);
msDoc.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateMinimize;
object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF;
msDoc.ActiveDocument.SaveAs(ref target, ref format,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN, ref UNKNOWN,
ref UNKNOWN, ref UNKNOWN);
問題是,執行SaveAs時會出現一個對話框。我試圖以編程方式禁用該對話框,以便用戶永遠不必提供Office/Word的輸入或配置。我正在寫的實用程序可能會有100次保存,所以彈出對話框不好。如何禁用「正在保存的文檔包含跟蹤的更改」Word對話框使用C#
我希望我能投票這十幾次...有一個郵件合併模板的保存對話框的問題,這完全保存了我的培根 – 2016-04-15 22:39:30