Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Code to create Workspace folder fails with "object doesn't support this action".
MarcelVanKempen
We want to add code to create first level folders to workspaces. The workspaces are all set up with a default set of folders but some departments want additional folders created when required.
I have got a workspace to which I have full access, I can create first level folders using the filesite right-click menu but not with this code.
Function CreateWorkspaceFolder(ByVal Client As String, ByVal Matter As String) As String
Dim oDMS As IManDMS
Dim oSession As IManSession
Dim oWorkArea As IManWorkArea
Dim oFolder As IManFolder
Dim oFolders As IManFolders
Dim oProfileSearchParams As IManProfileSearchParameters
Dim oWorkspaceSearchParams As IManWorkspaceSearchParameters
Dim oManStrings As ManStrings
Dim ItemByIndex As Integer
Set oDMS = New ManDMS
Set oSession = oDMS.Sessions.Add("D4MT")
oSession.TrustedLogin
Set oWorkArea = oSession.WorkArea
Set oManStrings = New ManStrings
oManStrings.Add oSession.Databases.ItemByIndex(1).Name
Set oWorkspaceSearchParams = oDMS.CreateWorkspaceSearchParameters
Set oProfileSearchParams = oDMS.CreateProfileSearchParameters
oProfileSearchParams.Add imProfileCustom1, Client
oProfileSearchParams.Add imProfileCustom2, Matter
‘
‘ Find the workspace for this client and matter, this works.
‘
Set oFolders = oSession.SearchWorkspaces(oManStrings, oProfileSearchParams, oWorkspaceSearchParams)
If oFolders.Count = 1 Then
Dim oNrtFolder As NRTFolder
OIALib.GetCurrentSessionDetails
‘
‘ Workspace and Folder objects do not seem to have methods to add subfolders, use an NrtFolder
‘
Set oNrtFolder = OIALib.pNRTDMS.GetObjectByID(oFolders.ItemByIndex(1).ObjectID)
‘
‘ Even though the operation is allowed, CreateSubFolder results in error 445: Object doesn’t support this action.
‘
If oNrtFolder.IsOperationAllowed(nrCreateSubFolderFolderOp) Then
oNrtFolder.CreateSubFolder "Tax", "Taxi", nrPublic
End If
End Function
Find more posts tagged with
Comments
guido1
No idea what your OIALib.GetCurrentSessionDetails call is doing, but it seems to me you're struggling to find the appropriate method to create a folder in the first place
Check out the IManWorkspace's DocumentFolders collection property. It has an AddNewDocumentFolder method (and an AddNewDocumentFolderInheriting method), which is I think what you're looking for