Vb 怎样用CreateObject引用Microsoft Scripting Runtime
帮我用CreateObject引用MicrosoftScriptingRuntime并且改一下,这个是我从网上下载来的。'要引用MicrosoftScriptingRun...
帮我用CreateObject引用 Microsoft Scripting Runtime
并且改一下,这个是我从网上下载来的。
'要引用Microsoft Scripting Runtime
Public Function 获取文件夹名(ByVal 路径 As String) As String
Dim MyFSO As New FileSystemObject
Dim MyFolder As Folder
Dim SFolder As Folder
Set MyFolder = MyFSO.GetFolder(路径)
For Each SFiles In MyFolder.SubFolders
获取文件夹名 = 获取文件夹名 & MyFolder.Path & "\" & SFiles.Name & Chr(13) & Chr(10)
Next
'========文件名=========
'For Each SFiles In MyFolder.Files
'获取文件夹名 = 获取文件夹名 & MyFolder.Path & "\" & SFiles.Name & Chr(13) & Chr(10)
'Next
'========================
End Function
因为每次我都要手动引用麻烦啊 展开
并且改一下,这个是我从网上下载来的。
'要引用Microsoft Scripting Runtime
Public Function 获取文件夹名(ByVal 路径 As String) As String
Dim MyFSO As New FileSystemObject
Dim MyFolder As Folder
Dim SFolder As Folder
Set MyFolder = MyFSO.GetFolder(路径)
For Each SFiles In MyFolder.SubFolders
获取文件夹名 = 获取文件夹名 & MyFolder.Path & "\" & SFiles.Name & Chr(13) & Chr(10)
Next
'========文件名=========
'For Each SFiles In MyFolder.Files
'获取文件夹名 = 获取文件夹名 & MyFolder.Path & "\" & SFiles.Name & Chr(13) & Chr(10)
'Next
'========================
End Function
因为每次我都要手动引用麻烦啊 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询