添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

获取文件路径:

Public Sub 文件路径()
Dim strFolder As String
'差异:msoFileDialogFilePicker
With Application.FileDialog(msoFileDialogFilePicker)

'文件对话框的题目,根据个人情况进行设定
.Title = "Select File"

'默认打开的文件对话框路径,此处是d盘
.InitialFileName = "d:\"
If .Show Then

'获取到路径
strFolder= .SelectedItems(1)
End If
End With
End Sub

获取文件夹路径:

Public Sub 文件夹路径()
Dim strFolder As String
'差异:msoFileDialogFolderPicker
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select Folder"
.InitialFileName = "d:\"
If .Show Then
strFolder= .SelectedItems(1)
End If
End With
End Sub

获取文件路径:Public Sub 文件路径()    Dim strFolder As String    '差异:msoFileDialogFilePicker    With Application.FileDialog(msoFileDialogFilePicker)        '文件对话框的题目,根据个人情况进行设定        .Title = "Select F...