How To Disable “The document being saved contains tracked changes” Word Dialog Using C#

calendar_today Asked Feb 22, 2011
thumb_up 9 upvotes
history Updated April 16, 2026

Question posted 2011 · +4 upvotes

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);

The problem is that when SaveAs is executed a dialog appears. I’m trying to disable that dialog programmatically so that the user never has to provide input or configuration of Office/Word. The utility I’m writing could potentially have 100s of saves so a pop-up dialog isn’t good.

Accepted answer +9 upvotes

I was able to figure out a programmatic solution by setting the following option in my code:

msDoc.Options.WarnBeforeSavingPrintingSendingMarkup = false;

Configuration wise I found you could also disable this Office feature by going into:

Word Options->Trust Center->Privacy Options->Uncheck “Warn before printing, saving or sending a file that contains tracked changes or comments”

VBA Core objects referenced (5)

  • Application — Using events with the Application object
  • Application — Working with Other Applications
  • Interop.Word — Exporting a Range to a Table in a Word Document
  • Interop.Word — Using events with the Application object (Word)
  • Microsoft.Office — Controlling One Microsoft Office Application from Another

Top ms-office Q&A (6)

+9 upvotes ranks this answer #7 out of 14 ms-office solutions on this site .