如何比较两个富文本字段
我想要一个脚本来比较表单一中名为 body 的两个富文本字段和表单 2 中名为 body1 的两个富文本字段的内容。 我创建了两个包含富文本类型字段的表单,并创建了一个分类视图,并在此视图中创建了一个名为“比较”的按钮,该按钮将比较这两个字段的包含内容并显示在消息中。
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须手动执行此操作。
您可以使用此处解释的搜索功能:
http://msdn.microsoft.com/en-us/library/bb787877%28VS.85%29.aspx#re_operations
搜索 box2 中 opf box1 的全部内容。如果找到匹配项,请检查该匹配项是否是 box2 的唯一内容。如果是这样,内容是相同的。
You will have to do this manually.
You could use the search-functionality as explained here:
http://msdn.microsoft.com/en-us/library/bb787877%28VS.85%29.aspx#re_operations
Search for the entire contents opf box1 in box2. If you get a match, check if this match is the only content of box2. if so, the contents are the same.