Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
IManDatabase.SearchWorkspaces... Com Error
JHDEV
I'm trying to search for a specific Workspace by name using this method. The Workspace is found but I get a COM error when I try to convert type.
public IManWorkspace getWorkspace(IManDatabase oDatabase, string workspaceName)
{
IManDMS objDMS = oDatabase.Session.DMS;
IManWorkspaceSearchParameters oManWorkspaceSearchParameters = objDMS.CreateWorkspaceSearchParameters();
IManProfileSearchParameters oManProfileSearchParameters = objDMS.CreateProfileSearchParameters();
oManProfileSearchParameters.Add(imProfileAttributeID.imProfileName, workspaceName);
IManWorkspace oWorkspace = (IManWorkspace) oDatabase.SearchWorkspaces(oManProfileSearchParameters, oManWorkspaceSearchParameters);
return oWorkspace;
}
//ERROR
Unable to cast COM object of type 'System.__ComObject' to interface type 'Com.Interwoven.WorkSite.iManage.IManWorkspace'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{170D30D1-0A0E-483D-805A-D40F2AB1983F}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Find more posts tagged with
Comments
Migrateduser
Search workspaces returns a collection of workspaces, even if that collection contains one item. Cast to a iManWorkspaces object, then loop though this to find the workspace you want,
Hope this helps
JHDEV
Thanks for the response. I have tried your suggestion, as well as many other attempts but it always returns null (no workspaces found) even if I pass in a workspace variable that is known to exist.
I've reviewed the SDK documentation and have been working on this for more than a day... it would be nice if I could find some code that works.
Thanks... I am still looking for further assistance.
Migrateduser
Ah, imProfileName is the Docmaster.Alias column, not used for most documents and not used at all for Workspaces
use imFolderAttributeID.imFolderDescription
JHDEV
I got it to work, thanks.