标题: 这个代码如何运行 [打印本页] 作者: aghuang 时间: 2007-1-23 11:23 标题: 这个代码如何运行 'create the foloder
Sub AddNewFolder(path, folderName)
Dim fso, f, fc, nf,msg,fso1
Set fso = CreateObject("scripting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fso1= CreateObject("scripting.FileSystemObject")
Set fc=f.SubFolders
If not (fso1.FolderExists(path&folderName)) Then
'msgbox "exists "
' Else
msg= MsgBox ("create the folder?", 4, "not find the test folder!")
If msg=6 Then '6yes,7no
Set nf = fc.Add(folderName)
End If
' Else
' Set nf = fc.Add("New Folder")
'End If
End If
End sub