.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: GetEntityAsText method
1. This agent gets the headers and content of a "text/plain" MIME entity and saves them to a TXT file.
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim stream As NotesStream
Set db = s.CurrentDatabase
s.ConvertMIME = False ' Do not convert MIME to rich text
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
If Not(doc Is Nothing) Then
Set mime = doc.GetMIMEEntity
If Not(mime Is Nothing) Then
If mime.ContentType = "text" And _
mime.ContentSubType = "plain" Then
Set stream = s.CreateStream
pathname$ = "c:\lotus\notes\data\temp.txt"
If Not stream.Open(pathname$, "us-ascii") Then
Messagebox pathname$,, "Open failed"
Goto ExitSub
End If
Call mime.GetEntityAsText(stream)
Else
Messagebox "Not plain text",, _
doc.GetItemValue("Subject")(0)
End If
Else
Messagebox "Not MIME",, doc.GetItemValue("Subject")(0)
End If
End If
s.ConvertMIME = True ' Restore conversion
ExitSub:
End Sub
2. This agent gets the headers and content of a "text/plain" MIME entity and saves them to a TXT file, including only the From and Subject headers.
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim stream As NotesStream
Set db = s.CurrentDatabase
s.ConvertMIME = False ' Do not convert MIME to rich text
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
If Not(doc Is Nothing) Then
Set mime = doc.GetMIMEEntity
If Not(mime Is Nothing) Then
If mime.ContentType = "text" And _
mime.ContentSubType = "plain" Then
Set stream = s.CreateStream
pathname$ = "c:\lotus\notes\data\temp.txt"
If Not stream.Open(pathname$, "us-ascii") Then
Messagebox pathname$,, "Open failed"
Goto ExitSub
End If
Dim filters(2) As String
filters(1) = "From"
filters(2) = "Subject"
Call mime.GetEntityAsText(stream, filters, True)
Call stream.Close()
Else
Messagebox "Not plain text",, _
doc.GetItemValue("Subject")(0)
End If
Else
Messagebox "Not MIME",, _
doc.GetItemValue("Subject")(0)
End If
End If
ExitSub:
s.ConvertMIME = True ' Restore conversion
End Sub
See Also
GetEntityAsText method
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents