A
Amedee Van Gasse
Hello,
I have the following snippets of code that creates a new directory
every year (code that has been in production since many years):
Public Const PublishDir = "http://teamsites.company.tld/sites/
department/project/
If Not DirectoryExists(PublishDir & sYear) Then MkDir (PublishDir &
sYear)
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
This works great on a filesystem (local and network). But I cannot get
it to work on Sharepoint. I understand that Sharepoint directories are
not real, only exist in the database, and are "created" on the fly.
However other file operations on Sharepoint have no problem at all in
Excel (or Word) VBA:
..SaveAs FileName:=PublishDir & sFilename
Any thoughts?
Anyone with hands-on experience with VBA+SharePoint? We're using
Office 2003 and MOSS 2007, should that matter.
I have the following snippets of code that creates a new directory
every year (code that has been in production since many years):
Public Const PublishDir = "http://teamsites.company.tld/sites/
department/project/
If Not DirectoryExists(PublishDir & sYear) Then MkDir (PublishDir &
sYear)
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
This works great on a filesystem (local and network). But I cannot get
it to work on Sharepoint. I understand that Sharepoint directories are
not real, only exist in the database, and are "created" on the fly.
However other file operations on Sharepoint have no problem at all in
Excel (or Word) VBA:
..SaveAs FileName:=PublishDir & sFilename
Any thoughts?
Anyone with hands-on experience with VBA+SharePoint? We're using
Office 2003 and MOSS 2007, should that matter.