PDA

View Full Version : How to Create folder in Web/sharepoint



Patricklckhk
04-28-2007, 08:40 AM
I would like to make a test whether the folder in a web is exist . If No, it will create the folder automatically >I can do it in the local drive (eg.C:\ etc) but when applied in web/sharepoint, seems the web can't recognized it.Can anyone help for it.Thks a lot....

Below is the code that I use when applied in the C:\
Sub testfolder()
Dim Test As New FileSystemObject
Dim test2 As Folders
test1 = "Mar-07"
If Test.FolderExists("C:\2007\" & test1) = True Then
Range("A1") = "File Exist"
Else: MkDir ("C:\2007\" & test1 & "\")
End If
End Sub

Bob Phillips
04-28-2007, 05:23 PM
Have you tried using a test like

If Test.FolderExists("http://website/" & test1) Then

Patricklckhk
04-28-2007, 06:46 PM
Yes, but the problems is no matter the folder is create or not it will go to the mkdir statement and have error message of "Path not found"