See my answer here.
Basically, you disable all alerts via the "Display Alerts" method:
Microsoft.Office.Interop.[OFFICE_APP].Application app = new Microsoft.Office.Interop.[OFFICE_APP].Application();
app.DisplayAlerts = false;
where [OFFICE_APP] is the name of the Office program you're using, such as Word, Excel, etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…