Hi,Can someone point me in the right dirrection as to how i would add profile attributes to a folder using vb.net.i am using the following line to add a folder to a workspace:Dim myDocFolder1 As IManDocumentFolder = myWorkspace.DocumentFolders.AddNewDocumentFolderInheriting(rr(0).ToString(), "Test Folder")i would like to add class, custom1 and custom2 information to the folder above.Are you looking to file the new folder under the workspace - so that the folder has the same profile as the workspace? Or, the new folder will have different values for class, custom1 and 2?Any code examples appreciated.Cheers,Maroun
Hi jny,Im looking to create and file the new folder under the workspace i would like it to inherit the custom1,2,3,4 values from the workspace and i would also like to add a class value thats not inherited from the workspace.the code im using to create the workspace and the folder is:' add workspaceDim myWorkspace As IManWorkspace = MyDatabase.CreateWorkspace Dim wsObjectId As String myWorkspace.Name = "Maroun Testing - " + r(0).ToString wsObjectId = myWorkspace.Name.ToString myWorkspace.Description = r(0).ToString myWorkspace.SubType = "Work" myWorkspace.SetAttributeByID(imProfileAttributeID.imProfileCustom1, r(1).ToString) myWorkspace.SetAttributeByID(imProfileAttributeID.imProfileCustom2, "1") Dim Filepath As String = Path.GetTempFileName Dim UpdateResults As IManProfileUpdateResult = myWorkspace.UpdateAllWithResults(Filepath) File.Delete(Filepath)' add folderDim myDocFolder1 As IManDocumentFolder = myWorkspace.DocumentFolders.AddNewDocumentFolderInheriting(rr(0).ToString(), "Test Folder")Thanks for the reply.
Dim oWS As IManWorkspaceDim oCmd As IManRefileCmdDim oContext As ContextItemsDim bRefresh'Assuming oWS is a valid workspace object Dim ofldr As IManDocumentFolder Set ofldr = oWS.DocumentFolders.AddNewDocumentFolderInheriting("test folder", "Added through APIs")Set oCmd = New IManRefileCmdSet oContext = New ContextItems' RequiredWith oContext.Add "ParentWindow", Me.hWnd.Add "SelectedIManObject", ofldr.Add "iManExt2.ObjectMoved", True' Optional.Add "IManExt2.RefileNoUI", True' True will suppress the refile dialog.Add "ConfirmMessages", False' False will suppress the confirmation dialog End WithWith oCmd.Initialize oContext.UpdateIf .Status = (.Status And nrActiveCommand) Then .Execute bRefresh = oContext("IManExt.Refresh") If bRefresh Then MsgBox "Done."End IfEnd With'Add class value to folderDim sFolderAttributeIDPrefix As StringsFolderAttributeIDPrefix = "iMan___" 'Case sensitiveoFldr.AdditionalProperties.Add sFolderAttributeIDPrefix & imProfileClass, "DOC" 'Example of a class nameoFldr.Update 'Commit changes to the server