Hi, we have a custom command for deleting documents from a right mouse click of a filesite document. I can identify a shortcut but have been unable to delete. Can anyone point me in the right direction for deleting the shortcut only - not the file it is referencing.The ICommand_Execute code I'm using to identify the shortcut is:*this code was with thanks to another thread posted by jny :-) Dim selectedObjects() As Object Dim selectedObject As IManObject Dim docShortcut As IManContentShortcut Dim mDoc As ManDocumentContents Dim ct As Integer selectedObjects = mContext("SelectedIManObjects") If Not IsEmpty(selectedObjects) Then ct = UBound(selectedObjects) - (LBound(selectedObjects) - 1) If ct = 1 Then mStatus = nrActiveCommand Set selectedObject = selectedObjects(0) Select Case selectedObject.ObjectType.ObjectType Case imTypeContentShortcut Set docShortcut = selectedObject *** Would like to delete docShortcut now Case imTypeDocument ' do other stuff End Select End If End If.. We are using Filesite 8.2 SP1 with patch 2 (soon going to patch 3).thanks in advancePG
Dim selectedObjects As Variant Dim selectedObject As IManObject Dim docShortcut As IManContentShortcut Dim docfldr As IManDocumentFolder Dim fldrs As IManFolders Dim shortcuts As IManContentShortcuts Dim doc As IManDocument Dim i, ct On Error GoTo ExecuteError selectedObjects = mContext("SelectedIManObjects") ' Get the folder that contains the shortcut Set docfldr = mContext("selectedContentsContainer") 'Or SelectedFolderObject, or SelectedNRTFolder If Not IsEmpty(selectedObjects) Then ct = UBound(selectedObjects) - (LBound(selectedObjects) - 1) For i = 0 To ct - 1 Set selectedObject = selectedObjects(i) Select Case selectedObject.ObjectType.ObjectType Case imObjectType.imTypeContentShortcut Set docShortcut = selectedObject Set shortcuts = docfldr.Contents shortcuts.RemoveByObject docShortcut Case imObjectType.imTypeDocument ' do other stuff End Select Next i End If