如何比较两个富文本字段

发布于 2024-10-05 18:47:11 字数 850 浏览 3 评论 0原文

我想要一个脚本来比较表单一中名为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽清梦 2024-10-12 18:47:12

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文