本文介绍了MS Office SaveAs类型FileDialog,在vb中带有过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个带有过滤器的另存为"文件对话框,但是使用FileDialog类(Microsoft Office 12.0对象库)似乎无法实现.该文档实际上在此处中提到,请参阅最后一段,但没有给出原因?在vb中还有另一种方法可以实现这一点吗?

I want to create a 'save as' file dialog with a filter, but this doesn't seem possible using the FileDialog class (Microsoft Office 12.0 Object Library). The documentation actually mentions this here, see last paragraph, but gives no reason as to why? Is there another way of achieving this in vb?

我很奇怪FileDialog类不允许这样做,因为Word,Excel和Access都内置了此精确的SaveAs功能.

I find it strange that the FileDialog class doesn't allow this because Word, Excel and Access all have this exact SaveAs feature built-in.

我意识到FileDialog可以创建为FilePicker(msoFileDialogFilePicker),它确实允许过滤器,但是这不允许选择一个尚不存在的文件,这使整个观点失去了作用.

I realise that the FileDialog can created as a FilePicker (msoFileDialogFilePicker) which does allow filters, but then this doesn't allow a file to be selected that doesn't yet exist, which defeats the whole point.

推荐答案

@AlexK提到的唯一方法是使用Windows API调用.请参见此处

As @AlexK mentioned the only way to do this is using a windows API call. See here

这篇关于MS Office SaveAs类型FileDialog,在vb中带有过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 08:02