Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在C#,I'中禁用对话wdDialogFileSaveAs中的格式字段;我正在处理草稿办公室加载项?_C#_Excel_Dialog_Ms Word_Ms Office - Fatal编程技术网

如何在C#,I'中禁用对话wdDialogFileSaveAs中的格式字段;我正在处理草稿办公室加载项?

如何在C#,I'中禁用对话wdDialogFileSaveAs中的格式字段;我正在处理草稿办公室加载项?,c#,excel,dialog,ms-word,ms-office,C#,Excel,Dialog,Ms Word,Ms Office,我正在为MicrosoftOffice2010和2013编程一个扩展,其中包括将当前文档保存为PDF。目前,我有以下代码 Microsoft.Office.Interop.Word.Dialog DialogBox = Globals.ThisAddIn.Application.Dialogs[Microsoft.Office.Interop.Word.WdWordDialog.wdDialogFileSaveAs]; System.Type DialogType = typeof(Micro

我正在为MicrosoftOffice2010和2013编程一个扩展,其中包括将当前文档保存为PDF。目前,我有以下代码

Microsoft.Office.Interop.Word.Dialog DialogBox = Globals.ThisAddIn.Application.Dialogs[Microsoft.Office.Interop.Word.WdWordDialog.wdDialogFileSaveAs]; System.Type DialogType = typeof(Microsoft.Office.Interop.Word.Dialog); object oDlg = (object)DialogBox; object[] oArgs2 = new object[1]; oArgs2[0] = (object)@"Documento.pdf"; oDlg.GetType().InvokeMember("Name", System.Reflection.BindingFlags.SetProperty, null, oDlg, oArgs2); object[] oArgs = new object[1]; oArgs[0] = (object)Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF; oDlg.GetType().InvokeMember("Format", System.Reflection.BindingFlags.SetProperty, null, oDlg, oArgs); object timeOut = null; int result = DialogBox.Show(ref timeOut); Microsoft.Office.Interop.Word.DialogBox=Globals.ThisAddIn.Application.Dialogs[Microsoft.Office.Interop.Word.WdWordDialog.wdDialogFileSaveAs]; System.Type DialogType=typeof(Microsoft.Office.Interop.Word.Dialog); 对象oDlg=(对象)对话框; object[]oArgs2=新对象[1]; oArgs2[0]=(对象)@“Documento.pdf”; GetType().InvokeMember(“Name”,System.Reflection.BindingFlags.SetProperty,null,oDlg,oArgs2); object[]oars=新对象[1]; oArgs[0]=(对象)Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF; GetType().InvokeMember(“格式”,System.Reflection.BindingFlags.SetProperty,null,oDlg,oArgs); 对象超时=空; int result=DialogBox.Show(参考超时); 这将显示Microsoft Office的本机文件保存对话框。它还将默认保存格式设置为PDF。但是,我需要保证该文件以PDF格式保存

是否有办法限制“文件保存”对话框仅显示PDF格式选项,并删除/隐藏所有其他选项