About This Code
Brief Description:
Document Synopsis
Contributor:
Andrew Jones
Last Modified:
17 Jun 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Code: Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim testdoc As NotesDocument
Dim Body As NotesRichTextItem
Dim tempRTitem As NotesRichTextItem
Dim getItem As NotesItem
Dim theSub As String
Dim itemname As String
Dim itemType As Integer
Dim rtitemText As String
Dim richStyle As NotesRichTextStyle
Dim richStyle2 As NotesRichTextStyle
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set richStyle = session.CreateRichTextStyle
richStyle.NotesFont = FONT_COURIER
richStyle.FontSize = 10
richStyle.Bold = True
Set richStyle2 = session.CreateRichTextStyle
richStyle2.NotesFont = FONT_COURIER
richStyle2.FontSize = 8
richStyle2.Bold = False
NumSel = dc.Count
For j = 1 To NumSel
Set doc = dc.GetNthDocument(j)
theSub = doc.GetItemValue("Subject")(0)
Set testdoc = New NotesDocument(db)
testdoc.Form = "Memo"
Set Body = New NotesRichTextItem(testdoc,"Body")
testdoc.Subject = ("Document Synopsis for: " & theSub)
Forall i In doc.items
itemType = i.Type
' itemValues(Ucase(i.Name)) = i.Text
itemname = i.Name
If itemType = 1 Then
Set tempRTitem = doc.GetFirstItem(itemname)
rtitemText = tempRTitem.GetFormattedText(True, 60)
Call Body.AppendStyle(richStyle)
Call Body.AppendText(Chr(10) & itemname & ": " & Chr(10))
Call Body.AppendStyle(richStyle2)
Call Body.AppendText(rtitemText & Chr(10))
Else
Call Body.AppendStyle(richStyle)
Call Body.AppendText(Chr(10) & itemname & ": " & Chr(10))
Call Body.AppendStyle(richStyle2)
Set getItem = doc.GetFirstItem(itemname)
Forall v In getItem.Values
Call Body.AppendText(Cstr(v) & Chr(10))
End Forall
End If
End Forall
Call testdoc.Save(True, False)
Call testdoc.PutInFolder("($Inbox)")
Next
End Sub
Usage / Example