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)
Outlook VBA - Search for Filesite document
Aphillippe
I'm trying to write VBA to perform a search for the document with a given document number.
Essentially I want to perform in code the equivalent of opening a search dialogue and searching for that number, i.e. that document should end up visible in the Outlook explorer.
I've got as far as locating the document in iManage with the following code:
Sub TestSearch()
Dim objDMS As IManDMS
Dim objSess As IManSession
Dim objWorkArea As IManWorkArea
Dim objDocs As IManDocuments
Dim strDocNumber As String
Dim objDoc As IManDocument
Dim objProfileSPs As IManProfileSearchParameters
Dim VARAuthorName As String
Dim VARAuthorDomain As String
Dim VARAuthorInitials As String
Dim VAROperatorName As String
Dim VAROperatorDomain As String
Dim VAROperatorInitials As String
Dim VARDescription As String
Dim VARMatter As String
Dim VARClient As String
Dim VARProfileDocNum As String
Dim ObjDocsCount As Integer
Set objDMS = New ManDMS
Set objSess = objDMS.Sessions.Add("REDACTED")
objSess.TrustedLogin
Set objWorkArea = objSess.WorkArea
strDocNumber = 103285570
Set objProfileSPs = objSess.WorkArea.Session.DMS.CreateProfileSearchParameters
objProfileSPs.Add imProfileAttributeID.imProfileDocNum, strDocNumber
Set objDocs = objWorkArea.Session.Databases.ItemByIndex(1).SearchDocuments(objProfileSPs, False)
ObjDocsCount = objDocs.Count
Set objDoc = objDocs.ItemByIndex(1)
VARProfileDocNum = objDoc.GetAttributeByID(imProfileDocNum)
VARAuthorName = objDoc.GetAttributeByID(imProfileAuthor)
VARAuthorDomain = objDoc.Author.DomainName
VARAuthorInitials = objDoc.Author.Extension
VAROperatorName = objDoc.GetAttributeByID(imProfileOperator)
VAROperatorDomain = objDoc.Operator.DomainName
VAROperatorInitials = objDoc.Operator.Extension
VARDescription = objDoc.GetAttributeValueByID(imProfileDescription)
VARMatter = objDoc.GetAttributeValueByID(imProfileCustom2)
VARClient = objDoc.GetAttributeValueByID(imProfileCustom1)
End Sub
The variables return the profile data of the required file and this proves that I'm connecting ok and finding the right file.
What I need to do now is the next step to actually perform the search. I have a feeling that I need to create a new explorer, then activate the search, but I have no clue.
Any help is appreciated.
Find more posts tagged with
Comments
There are no comments yet