Robert Axelrod commented on Jan 19, 2011

Re: Reading the MTSTORE Database

Two things...

First a question do you have any idea what the number mean when there is a number formatted like '34' in the sender or recipient fields? Not only that but they also seem to appear in the server fields.

Second a bit of code to export the data out to a text file for analysis in Excel or Access. Just put this in an agent in the mtdata database. You can then select documents and run the agent:

%REM

Agent export data

Created Oct 26, 2009 by Rob B Axelrod/Technotics

Description: Comments for Agent

%END REM

Option Public

Option Declare

Sub Initialize()

Dim Session As New NotesSession

Dim CurrentDb As NotesDatabase

Dim Doc As NotesDocument

Dim Col As NotesDocumentCollection

Dim View As NotesView

Dim UIW As NotesUIWorkspace

Dim OutputStr As String

Dim i As Long

Dim InputFileName As Variant

Dim x As Long

x = 0

Set UIW = New NotesUIWorkspace

Set Session = New NotesSession

Set CurrentDb = Session.CurrentDatabase

Set View = CurrentDb.GetView("MailTracking Data")

Set Col = CurrentDb.Unprocesseddocuments

Set Doc = Col.GetFirstDocument

InputFilename = UIW.OpenFileDialog(False, "Where should the output go")

If Not IsEmpty(InputFileName) Then

Open InputFileName(0) For Append As #1

Else

Exit Sub

End If

Print #1, "Time Dispatched" & "," & "Size" & "," & "Message Type" & "," & "Recipient" & "," & "Sender" & "," & "Msg ID" & "," & "Source Server" & "," & "Next Server"

Do Until Doc Is Nothing

For i = 0 To UBound(Doc.DispStat)

If Doc.DispStat(i) = 4 Then

OutputStr = Doc.DISPTM(i) & "," & Doc.MSGSZ(i) & "," & Doc.MSGTYPE(i) & "," & Doc.INRCP(i) & "," & Doc.INORG(i) & "," & Doc.UNQMSGID(i) & "," & Doc.PREVMTA(i) & "," & Doc.NEXTMTA(i)

Print #1, OutputStr

End If

Next i

Set Doc = Col.GetNextDocument(Doc)

Print x

x = x + 1

Loop

End Sub