public static void Close(IVisio.Document doc, bool force_close) { if (force_close) { var new_alert_response = VA.Application.AlertResponseCode.No; var app = doc.Application; using (var alertresponse = new VA.Application.AlertResponseScope(app,new_alert_response)) { doc.Close(); } } else { doc.Close(); } }