本文介绍了在Access 2007中打开“文件对话框"并获取文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开文件对话框并获取Access 2007中所选路径的目录.

我知道要打开文件对话框,但我不知道该函数会返回您使用的F.FileName目录,但会给我一个错误.这是我使用的代码:

I want to open the file dialog and get the directory of the selected path in access 2007.

I know to open the file dialog but I did not know the function that return you the directory I used F.FileName but gives me an error. this is the code that I used:

Dim f    As Object
Set f = Application.FileDialog(msoFileDialogFilePicker)
f.AllowMultiSelect = False
f.Title = "Please Select an Excel Sheet"
f.Filters.Clear
f.Show
txt_Path.Text = f.FileNameToString()//gives me Error how can i fix it


错误是对象不支持此属性或方法"


the error is "Object does not support this property or method"
Can any one help me in doing that?

推荐答案


'Loop through each file selected and do whatever you want to do with it.
For Each varFile In .SelectedItems
  'varFile - this is your file name
Next




来源: http://bytes.com/topic/access/answers/539285-file-dialog [< ^ ]




Souce: http://bytes.com/topic/access/answers/539285-file-dialog[^]


这篇关于在Access 2007中打开“文件对话框"并获取文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 06:18