0

I want a script which will compare the content of two richtext field named body in form one and body1 in form2. I have created two forms whcich contain a richtext type field and created a categerioze view and created a button named compare in this view which will compare the contain of these two fieds and display in a message.

Sub Click(Source As Button)

 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim dc As NotesDocumentCollection
 Dim doc, doc1 As NotesDocument
 Dim body, body1 As Variant
 Dim view As NotesView
 Dim rtitem As NotesRichTextItem

 Set session = New NotesSession
 Set db = session.CurrentDatabase
 Set dc = db.UnprocessedDocuments
 Set doc = dc.GetFirstDocument
 Set doc1=dc.GetNextDocument(doc)

 body = doc.GetItemValue( "body" )
 Msgbox  body( 0 ), ,"Richtext field of First form"

 body1=doc1.GetItemValue("body1")
 Msgbox body1( 0 ) ,, "Rich Text field of Second form"


 'If  body.value=body1.value Then
 Msgbox"both are same"
 'End If
 Msgbox"both are different"

End Sub
4

1 回答 1

0

您必须手动执行此操作。您可以使用此处解释的搜索功能:

http://msdn.microsoft.com/en-us/library/bb787877%28VS.85%29.aspx#re_operations

在 box2 中搜索 opf box1 的全部内容。如果得到匹配项,请检查该匹配项是否是 box2 的唯一内容。如果是,则内容相同。

于 2010-12-02T09:47:05.580 回答