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)
Running imanext.SearchCms from Outlook add-in
Aphillippe
I'm trying to launch the document search dialogue using imanext.searchcmd in a COM add-in written in VB.Net using Visual Studio 2008. I've got as far as the dialogue popping up but I get the following Filesite error:
IManExt: Unable to get object from id !nrtdms:0:!session:BBGSYDMS01:!database:BBGSY:.
Access is denied.
I am opening up a new session (oSess) at the start of the Sub. Is this where I'm going wrong?
I read in the SDK manuals that I should use the existing session, not create a new one. Unfortunately I can't find any reference of how to find the existing session and pass it to the relevant contextitem from Outlook (only Word and Excel using imano2k).
Does anyone know how to get the current session?
Code as follows:
Private Sub LaunchSearch_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef canceldefault As Boolean) Handles LaunchSearch.Click
Dim oDMS As IManage.IManDMS
Dim oSess As IManage.IManSession
oDMS = New ManDMS
oSess = oDMS.Sessions.Add("BBGSYDMS01")
oSess.TrustedLogin()
Dim pSearchCmd As IMANEXTLib.SearchCmd
Dim pContextItems As IMANEXTLib.ContextItems
Dim pArrSession(0) As IManage.NRTSession
Dim pNRTDMS(0) As IManage.NRTDMS
Dim pParentWindow As Long
pParentWindow = GetForegroundWindow()
' Create a new ContextItems collection
pContextItems = New IMANEXTLib.ContextItems
'Create a new SearchCmd object
pSearchCmd = New IMANEXTLib.SearchCmd
' Assign NRTSession object to pArrSession array
pArrSession(0) = oSess
pNRTDMS(0) = oDMS
' Populate the ContextItems collection with required values
pContextItems.Add("ParentWindow", pParentWindow)
pContextItems.Add("NRTDMS", pNRTDMS)
pContextItems.Add("SelectedNRTSessions", pArrSession)
' Initialize the command with populated ContextItems Collection
pSearchCmd.Initialize(pContextItems)
' Use the Update method to find out if the command is
' available, based on the information posted to the
' ContextItems collection
pSearchCmd.Update()
' If the command is active, it can be executed.
'If pSearchCmd.Status = (pSearchCmd And nrActiveCommand) Then
pSearchCmd.Execute()
'End If
End Sub
Find more posts tagged with
Comments
Aphillippe
Ok, further to the above post, I have since tried using the imano2k.dll approach to an existing session instead of creating a new one. The problem is, creating a new excel.application as in the SDK manuals, the COM add-in for that instance is in nrIndeterminatemode, and there are no contextItems.
If I use the existing excel.application using getobject instead of createobject, it works fine. But that assumes that there is an instance of excel already running. If not, and I create one, it goes to nrIndeterminatemode. So:
1) is there any way to get the existing session used by Filesite without using excel or word (i.e. directly through Outlook/Filesite)?
2) If not, is there any way to create an excel.application that starts the Com add-in in nrConnectedmode?
3) Is there something else that I am missing to allow me to launch iManExt.SearchCmd straight out of Outlook?
Any help much appreciated.