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)
SearchCmd to search a diferent Database
pmpg
Hi all,
I have a implementation with 3 databases and need to add to FileSite Toolbar a custom button to search each one of the databases.
I tryed to create a ICommand using the SearchCmd but the results are not displayed in the document grid of Outlook.
How can I have custom buttons in the toolbar to search diferent databases.
Thank you all...
The code I was trying to execute
------------
Private Sub ICommand_Execute()
On Error GoTo ExecuteError
Dim pSearch As New IMANEXTLib.SearchCmd
Dim pContext As New IMANEXTLib.ContextItems
Dim bRefresh As Boolean
Dim OverFlow As String
Dim pSearchParams As IManage.NRTSearchParameters
Dim pSearchedNRTDocs As IManage.NRTDocuments
'pContext = mContext
Set pContext = mContext
'pContext.Add "ParentWindow", mContext.Item("ParentWindow")
'pContext.Add "NRTDMS", mContext.Item("NRTDMS")
'pContext.Add "SelectedNRTSessions", mContext.Item("SelectedNRTSessions")
pContext.Add "SearchDatabaseName", "PRINCIPAL"
With pSearch
.Initialize pContext
.Update
If .Status = (.Status And nrActiveCommand) Then
.Execute
End If
bRefresh = pContext.Item("IManExt.Refresh")
OverFlow = pContext.Item("varOverFlow")
Set pSearchedNRTDocs = pContext.Item("SearchedNRTDocuments")
Set pSearchParams = pContext.Item("SearchParameters")
End With
ExecuteError:
End Sub
------------
Find more posts tagged with
Comments
james_sillett
Hi, im trying to do the same thing did you ever managed to do this ?
pmpg
Hi, im trying to do the same thing did you ever managed to do this ?
Unfortunatlly No
guido1
Are you hoping to create a custom ICommand that executes from the Outlook toolbar?
ICommands are used to customise and/or extend the existing context-sensitive commands in the FileSite tree, e.g. when you right-click on a WorkSite folder, and not for customising the Outlook client itself.
To create a new toolbar button in Outlook you should create a COM or VSTO addin, and then call your WorkSite code from there.
james_sillett
Thanks for your reply. What im trying to do is return the results from SDK search back to the grid on outlook. So via Icommand a user will be able to click an outlook shortcut and this use the sdk to doo pre programmed seach (all of this I can do) then return the result back into outlook gird (this I cant)
cheers
paulo_freire
Managed to solve it in 2 ways.
First one when you dont have to deploy it in many pcs is just Crate a vba in outlook with the folowing code and a button to call it.
You have to make one for each database search.
Public Sub test999()
On Error GoTo error:
Dim ofolderSource As Outlook.MAPIFolder
Check if you'r on the Filesite
Set ofolderSource = Application.ActiveExplorer.CurrentFolder
If InStr(1, ofolderSource.FolderPath, "FileSite") = 0 Then
Beep
MsgBox "Please go to the FileSite first ", vbInformation
Exit Sub
End If
'Execute search
ActiveExplorer.CommandBars("menu bar").Controls("FileSite").Controls("Database Search").Controls("database1").Execute
Exit Sub
erro:
MsgBox "File site not activated."
End Sub
Second one is when you have to deploy it into several pcs and want to make it automatically.
Create a Outlook Add-in with Visual Studio and use the send keys to make the correct select sequence of the database.
This solution is not perfect but i was unable to select the item on the filesite toolbar becoz all the items in the filesite toolbar have the same id. (1) .
I can select any item in the outlook bar and execute them, but no luck with the items in the filesite.
This was tested with Outlook 2007 and Visual Studio 2005.
guido1
Your solution might be more robust if you created a custom WorkSite command (an ICommand implementation) and registered it here:
HKLM\Software\Interwoven\WorkSite\8.0\FileSite\Commands\ToolBar\Commands
This will automatically insert your command as a new toolbar button in the WorkSite Toolbar in Outlook (if you have version 8.2, at least). It also avoids the pitfalls of a wobbly sendkeys implementation as well as Outlook add-in development/deployment