在Microsoft Office互操作FileSaveAs方法禁用覆盖现有文件的提示 [英] disabling overwrite existing file prompt in Microsoft office interop FileSaveAs method

查看:475
本文介绍了在Microsoft Office互操作FileSaveAs方法禁用覆盖现有文件的提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的MS Office的互操作组件,以创建一个MS Project文件。要保存文件创建的,我使用FileSaveAs方法,它会提示一个消息说,如果你要替换现有文件。
我想打压消息,我没有发现用于此目的的方法FileSaveAs任何参数。
在这个任何想法?使用C#作为我的编程语言
我'。

I am using Ms Office Interop assemblies to create a MS Project file. To save the file created, I am using FileSaveAs method and it prompts a message saying that if you want to replace the existing file. I want to suppress the message, and I didn't find any parameter in FileSaveAs method for this purpose. Any Idea on this? I'am using C# as my programming language.

推荐答案

我用Excel互操作时遇到了这个问题。我已经能够找到的最好的是禁用的所有的办公室提醒,像这样的:

I ran into this issue when working with Excel Interop. The best I've been able to find is to disable all Office alerts, like this:

Microsoft.Office.Interop.MSProject.Application msProjectApp = new Microsoft.Office.Interop.MSProject.Application();
msProjectApp.DisplayAlerts = false;

这篇关于在Microsoft Office互操作FileSaveAs方法禁用覆盖现有文件的提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆