Office中国论坛/Access中国论坛

标题: 支持多选的文件对话框 [打印本页]

作者: andymark    时间: 2007-12-13 22:17
标题: 支持多选的文件对话框
需引用 Microsoft Office 10.0 Object Library 或更高版本
  1. Dim fDialog As Office.FileDialog
  2. Dim varFile As Variant

  3. 'Clear listbox contents.
  4. Me.FileList.RowSource = ""

  5. 'Set up the File Dialog.
  6. Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
  7. With fDialog
  8. 'Allow user to make multiple selections in dialog box
  9. .AllowMultiSelect = True

  10. 'Set the title of the dialog box.
  11. .Title = "lease select one or more files"

  12. 'Clear out the current filters, and add our own.
  13. .Filters.Clear
  14. .Filters.Add "Access Databases", "*.MDB"
  15. .Filters.Add "Access Projects", "*.ADP"
  16. .Filters.Add "All Files", "*.*"

  17. 'Show the dialog box. If the .Show method returns True, the
  18. 'user picked at least one file. If the .Show method returns
  19. 'False, the user clicked Cancel.
  20. If .Show = True Then
  21. 'Loop through each file selected and add it to our list box.
  22. For Each varFile In .SelectedItems
  23. Me.FileList.AddItem varFile
  24. Next
  25. Else
  26. MsgBox "You clicked Cancel in the file dialog box."
  27. End If
  28. End With
复制代码


作者: Victor_Duane    时间: 2007-12-13 22:21
我下了看看,呵呵
作者: Victor_Duane    时间: 2007-12-13 22:21
难得坐了个沙发也,真不错,ANDYMARK真是太好了,哈哈哈
作者: goto2008    时间: 2007-12-13 22:24
学习。。。。好奇怪的功能。。
作者: Victor_Duane    时间: 2007-12-13 22:25
不奇怪,很实用的一个功能,嘿嘿,
作者: 5988143    时间: 2007-12-14 08:00
謝謝分享!
作者: feigao186    时间: 2007-12-14 08:09
应该学习看看下载了呀
作者: feigao186    时间: 2007-12-14 08:10
学习没发现的好功能呀
作者: tmtony    时间: 2007-12-14 09:09
很好的代码!!
作者: t小宝    时间: 2007-12-14 23:22
好东西,支持......
不知Access2000能不能用?
作者: zhichaochen    时间: 2007-12-22 13:06
怎么 引用 Microsoft Office 10.0 Object Library 或更高版本 这个呢,
我使用这个运行不了
作者: 好学    时间: 2007-12-22 13:23
好东西啊,谢谢分享!
作者: suve    时间: 2008-3-23 12:28
标题: andymark!!!
[:17] [:17] [:17]
作者: tanhong    时间: 2008-9-7 09:44
实为精品,
作者: chenwm1973    时间: 2008-9-7 09:55
[:50] [:50] [:50]
[:22] [:22]
作者: 13555609005    时间: 2008-9-8 16:08
学习吓
作者: bpchan    时间: 2008-10-28 12:15
标题: dddddd
ddddddddddd
作者: 小小鸟    时间: 2008-11-13 12:48
谢谢分享,下载学习。
作者: ynjxw    时间: 2008-12-3 11:33
see
作者: huangyz_xy    时间: 2008-12-11 21:14
正需要呢!
作者: huangyz_xy    时间: 2008-12-12 16:20
比如我现在选择的是一批XLS文档,我要一个一个但不重复的导入到当前数据库,怎样一个一个的读取出文件名,能用代码告知吗?
作者: xuwenning    时间: 2008-12-12 16:48
学习
学习
[:50]
作者: cashiba    时间: 2008-12-12 21:28
+++++++++++++++++++++++++++++++++++++++++++++++
我爱就有希望 每天一小步 都有新高度
作者: lhsh    时间: 2008-12-13 14:59
看看学习
作者: becao    时间: 2008-12-16 20:33
支持多选的文件对话框
需引用 Microsoft Office 10.0 Object Library 或更高版本
作者: 付谦    时间: 2008-12-25 14:17
标题: 回复 1# 的帖子
????????????????????????
作者: jimchen    时间: 2009-1-12 10:58
看看先
作者: aalons    时间: 2009-2-16 01:11
很好的代码!!
作者: luhao    时间: 2009-3-6 22:19
学习下
作者: towerman    时间: 2009-3-7 08:23
好 好
作者: apsfxc1    时间: 2009-8-19 09:38
学习..
作者: chaojianan    时间: 2009-10-14 21:17
实用,收藏。
作者: tuisi    时间: 2010-3-26 10:25
先看看隐藏内容
作者: alonet    时间: 2012-3-2 14:27
看看
作者: seanone    时间: 2012-3-5 08:52
有道理,好东西支持一下
作者: xie62    时间: 2012-3-5 08:57
谢谢分享
作者: Superleistung    时间: 2016-6-6 15:35
学习一下
作者: sxgaobo    时间: 2018-5-19 02:35
学习学习!!!
作者: 六月雪    时间: 2018-5-19 03:41
哦哦哦哦哦哦哦哦哦哦
作者: wgh3g    时间: 2018-5-20 12:09
实用

作者: ardu95    时间: 2018-5-20 21:35
学习了,谢谢分享。

作者: NGQ208208    时间: 2018-8-2 23:31
谢谢分享
作者: JosephJostar    时间: 2018-10-12 09:48
学习一下




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3