lzth.net
当前位置:首页 >> VBA,调出文件选择窗口(AppliCAtion.FilEDiAlog) >>

VBA,调出文件选择窗口(AppliCAtion.FilEDiAlog)

参考代码如下: dim FileSelected as string FileSelected = Application.GetSaveAsFilename(InitialFileName:="", _ FileFilter:="PDF Files (*.pdf), *.pdf", _ Title:="另存为pdf") If Not FileSelected "False" Then MsgBox "用户已取消保存...

引用windows的对话框都不行。。。 它们都是最先输出最后一个选择的文件名,最后一个选择之前选择的文件名按名字排序,即: 数字

Application.FileDialog(msoFileDialogFilePicker)

Sub aa() Dim mm Set mm = Application.FileDialog(msoFileDialogFolderPicker) With mm .InitialFileName = "E:\数据文件" '定义“E:\数据文件”为默认路径 End With mm.Show End Sub

'注意引用microsoftoffice 10.0 (或以上)object library'在文件对话框对中返回选择一个文件夹的路径.Public Function ChooseFolder() As StringDim dlgOpen As FileDialogSet dlgOpen = Application.FileDialog(msoFileDialogFolderPicker)Wit...

不会弹出对话框吧。代码可简化一下: Set fd = Application.FileDialog(msoFileDialogFolderPicker) '允许用户选择一个文件夹 fd.InitialFileName = "\\PIC\2015\" '定义默认路径

不可以,没有类似的参数。 Dim fPath As String With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = False .Filters.Add "All Files", "*.*" 'everything .Filters.Add "Text Files", "*.txt", 1 'default .Show If .Selected...

建议用FileSystemObject操作: 示例 Sub ReadTextFile() Dim fs As Object Dim objFile As Object Dim strContent As String Dim strFileName As String strFileName = "C:\aaa.txt" '此处可以用其他变量代替Set fs = CreateObject("Scripting.F...

没有item这个属性 参考 Sub UseFileDialogOpen() Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = True .Show ' Display paths of each file selected For lngCount = 1 To ....

不会弹出对话框吧。代码可简化一下: Set fd = Application.FileDialog(msoFileDialogFolderPicker) '允许用户选择一个文件夹 fd.InitialFileName = "\\PIC\2015\" '定义默认路径

网站首页 | 网站地图
All rights reserved Powered by www.lzth.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com