我想要一个脚本,它将比较表单1中名为body的两个richtext字段和form2中的body1的内容。 我创建了两个包含richtext类型字段的表单,并创建了一个categerioze视图,并在此视图中创建了一个名为compare的按钮,该按钮将比较这两个fied的包含并显示在消息中。
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
答案 0 :(得分:0)
您必须手动执行此操作。 您可以使用此处所述的搜索功能:
http://msdn.microsoft.com/en-us/library/bb787877%28VS.85%29.aspx#re_operations
在box2中搜索opf box1的全部内容。如果你得到一个匹配,检查这个匹配是否是box2的唯一内容。若然,内容相同。