如何显示"打开文件"对话在Access 2007 VBA? [英] How to show "Open File" Dialog in Access 2007 VBA?

查看:310
本文介绍了如何显示"打开文件"对话在Access 2007 VBA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何着手显示打开的文件(或文件选择)对话框在Access 2007 VBA?

How would I go about showing an open file (or file select) dialog in access 2007 VBA?

我用Application.GetOpenFileName已经试过,因为我会在Excel中,但这一功能并不在Access中存在。

I have tried using Application.GetOpenFileName as I would in Excel, but this function doesn't exist in Access.

推荐答案

我在雷诺Bompuis的答复意见搞砸了。

My comments on Renaud Bompuis's answer messed up.

其实,你可以使用后期绑定,不需要引用11.0对象库。

Actually, you can use late binding, and the reference to the 11.0 object library is not required.

下面code将工作没有任何参考文献:

The following code will work without any references:

 Dim f    As Object 
 Set f = Application.FileDialog(3) 
 f.AllowMultiSelect = True 
 f.Show 

 MsgBox "file choosen = " & f.SelectedItems.Count 

请注意,上面的效果很好,在运行时也。

Note that the above works well in the runtime also.

这篇关于如何显示"打开文件"对话在Access 2007 VBA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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