A
Amedee Van Gasse
I have written the following function that checks is a directory
exists.
I'm posting to Excel and Word-related groups, because I use these
functions in Excel and Word, both 2003 versions. I'm also posting to a
SharePoint group because my function has an issue with SharePoint
(MOSS 2007).
Function DirectoryExists(ByVal PathName As String) As Boolean
'Macro Purpose: Function returns TRUE if the specified
' folder exists, false if not.
'declarations
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'determine if it exists
DirectoryExists = objFSO.FolderExists(PathName)
'close everything up
Set objFSO = Nothing
End Function
My question: why does this function return false on an existing
SharePoint directory? For example:
Debug.Print DirectoryExists("http://teamsites/sites/lolcats/foo/bar/")
I have not yet tested, but I have a similar function that creates a
directory (after I have checked that it doesn't exist), and I expect
it will fail too. Is there something special about SharePoint that
causes the FileSystemObject not to behave as expected?
exists.
I'm posting to Excel and Word-related groups, because I use these
functions in Excel and Word, both 2003 versions. I'm also posting to a
SharePoint group because my function has an issue with SharePoint
(MOSS 2007).
Function DirectoryExists(ByVal PathName As String) As Boolean
'Macro Purpose: Function returns TRUE if the specified
' folder exists, false if not.
'declarations
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'determine if it exists
DirectoryExists = objFSO.FolderExists(PathName)
'close everything up
Set objFSO = Nothing
End Function
My question: why does this function return false on an existing
SharePoint directory? For example:
Debug.Print DirectoryExists("http://teamsites/sites/lolcats/foo/bar/")
I have not yet tested, but I have a similar function that creates a
directory (after I have checked that it doesn't exist), and I expect
it will fail too. Is there something special about SharePoint that
causes the FileSystemObject not to behave as expected?