0

2つのリッチテキストフィールドの文字列を比較できるロータススクリプトコードが必要です。form1とform2という名前の2つのフォームがあり、各フォームに1つのリッチテキストフィールド名「body」と「body1」がコードからあります。両方のフィールドの値を取得できるので、これら2つのフィールドを比較して、メッセージボックス内の文字列。

私のコードは:

Sub Click(Source As Button)

 Dim session As NotesSession
 Dim db As NotesDatabase
 Dim dc As NotesDocumentCollection
 Dim doc, doc1 As NotesDocument
 Dim text1 As NotesItem
 Dim text2 As NotesItem
 Dim str1 As String

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

 Set text1=doc.getfirstitem("body")
 Set text2 = doc1.getfirstitem( "body1" )

 'Forall v In text1.Values

 v=text1.Values
 v1=text2.Values
 Messagebox( v ) 
 Messagebox( v1) 
 If Len(v) =Len(v1) Then 
  Msgbox"both the fields have same number of strings"
 Else
  If Len(v) >Len(v1) Then 
   Msgbox"the length of the string in body field of form1 is greater"
  Else
   Msgbox"the length of the string in body1 field of form2 is greater"
  End If
 End If


End Sub
4

1 に答える 1

0

単純なテキスト差分アルゴリズムを実装する必要があります。車輪の再発明をしたくない場合は、VB diff関数を取得して、Lotusscriptに適合させることをお勧めします。

于 2011-01-23T12:02:27.147 に答える