cancel
Showing results for 
Search instead for 
Did you mean: 

How can Enterprise Vault be searched with an Outlook COM object?

T1ppex
Level 2

I can programatically search through my Outlook folder for my automation work, but most of my emails are archived in Enterprise Vault and I'm looking for a way to programatically search them in the same [type of] way please.

The nearest I have got is just to find results from the archive summary left in Sent Items but I'd like to search in the archived original and (hopefully) have a way to programmatically extract (save) the item I'm after.

 Any help/ideas please?

  $oOutlook = ObjCreate("Outlook.Application");Start the Outlook COM object
  $NameSpace = $oOutlook.GetNameSpace("MAPI")
  ;  $FolderID selection from:
  ;   1  = Appointment items
  ;   3  = Deleted items
  ;   4  = Outbox
  ;   5  = Sent Items
  ;   6  = Inbox
  ;   9  = Calendar
  ;   10 = Contacts
  ;   11 = Journal
  ;   12 = Notes
  ;   13 = Tasks
  ;   16 = Drafts
  ;   18 = All Public Folders
  ;    19 = Folder Conflicts
  ;                       20 = Folder Sync Issues
  ;                       21 = Local Failures
  ;    22 = Server Failures
  ;   23 = Junk
  Local $FolderID = 5 ;Sent Items
  Local $Folder = $NameSpace.GetDefaultFolder($FolderID)
  Local $FolderItems = $Folder.Items
  Local $NumberOfItems = $FolderItems.Count
  For $Pos = 1 To $NumberOfItems Step 1
     $message = $FolderItems.Item($Pos)
     If StringInStr($message.Body, "Hello World") Then
        MsgBox(0, "Found Email", $Message.Subject & " - Sent on " & $Message.SentOn & " - " & $SentFormatDate & " - " & $SentDate)
     Endif
  Next

1 ACCEPTED SOLUTION

Accepted Solutions

JesusWept3
Level 6
Partner Accredited Certified
Well if the user has virtual vault you could just trawl through the stores until you hit the users virtual vault and go through there searching your items However it's probably not going to work so well due to the structure of VV/VC; you'd probably end up with out of memory errors quite quickly But honestly at that point itd be easier to use WDS and search from there as it has a specific interface for it to search the DB files Other than that you'd have to do an online EV search which means you'd need the Ali installed on the machines and the API guide is distributed only to STEP partners etc
https://www.linkedin.com/in/alex-allen-turl-07370146

View solution in original post

2 REPLIES 2

JesusWept3
Level 6
Partner Accredited Certified
Well if the user has virtual vault you could just trawl through the stores until you hit the users virtual vault and go through there searching your items However it's probably not going to work so well due to the structure of VV/VC; you'd probably end up with out of memory errors quite quickly But honestly at that point itd be easier to use WDS and search from there as it has a specific interface for it to search the DB files Other than that you'd have to do an online EV search which means you'd need the Ali installed on the machines and the API guide is distributed only to STEP partners etc
https://www.linkedin.com/in/alex-allen-turl-07370146

T1ppex
Level 2

Thank you for posting.

I was hoping it may be a simple as just knowing the correct "$FolderID" number to use when querying the Outlook COM object on the user's PC

Local $Folder = $NameSpace.GetDefaultFolder($FolderID)

(please see first post which clarifies)

Anyone have any ideas please?