Examples: GetSomeHeaders method

This agent gets the Subject and From headers in the MIME entity in the current document.

Sub Initialize
  Dim s As New NotesSession
  Dim db As NotesDatabase
  Dim dc As NotesDocumentCollection
  Dim doc As NotesDocument
  Dim mime As NotesMIMEEntity
  Set db = s.CurrentDatabase
  s.ConvertMIME = False ' Do not convert MIME to rich text
  Set dc = db.UnprocessedDocuments
  Set doc = dc.GetFirstDocument
  While Not(doc Is Nothing)
    Set mime = doc.GetMIMEEntity
    If Not(mime Is Nothing) Then
      Dim filter(2) As String
      filter(0) = "Subject"
      filter(1) = "From"
      Messagebox mime.GetSomeHeaders(filter, True),, _
      doc.GetItemValue("Subject")(0)
    Else
      Messagebox "Not MIME",, doc.GetItemValue("Subject")(0)
    End If
    Set doc = dc.GetNextDocument(doc)
  Wend
  s.ConvertMIME = True ' Restore MIME conversion
End Sub