LOTUSSCRIPT/COM/OLE CLASSES
Dim session As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim mainDoc As NotesDocument Dim responseDoc As NotesDocument Set db = session.CurrentDatabase Set view = db.GetView( "Main View" ) ' get the first document in the view, which is a Main Topic Set mainDoc = view.GetFirstDocument ' visit every Main Topic in the view While Not ( mainDoc Is Nothing ) ' get the first response to the Main Topic Set responseDoc = view.GetChild( mainDoc ) ' visit every response to the Main Topic While Not ( responseDoc Is Nothing ) If Not (responseDoc.HasItem("OriginalSubject")) Then ' copy the Main Topic's Subject item into the ' Response's OriginalSubject item Call responseDoc.AppendItemValue _ ( "OriginalSubject", _ mainDoc.GetItemValue( "Subject" ) ) Call responseDoc.Save( True, False ) End If ' get the next response to the Main Topic Set responseDoc = view.GetNextSibling( responseDoc ) Wend ' get the next Main Topic Set mainDoc = view.GetNextSibling( mainDoc ) Wend