LOTUSSCRIPT /COM/OLE のクラス
例:GetParentDocument メソッド
1. 次のスクリプトはディスカッションデータベースの [By Category] ビューで最後の文書の親文書を検索し、ユニバーサル ID を表示します。
Sub Click(Source As Button)
Dim db As New NotesDatabase( "Byzantium", "discuss.nsf" )
Dim view As NotesView
Dim doc As NotesDocument
Dim parentDoc As NotesDocument
Set view = db.GetView( "By Category" )
If view Is Nothing Then
Messagebox "View not found"
Exit Sub
End If
Set doc = view.GetLastDocument
If doc Is Nothing Then
Messagebox "Last document not found"
Exit Sub
End If
If doc.IsResponse Then
Set parentDoc = view.GetParentDocument( doc )
If parentDoc Is Nothing Then
Messagebox "Error reading parent document"
Exit Sub
End If
Messagebox parentDoc.UniversalID, , _
"UNID of parent of last document"
Else
Messagebox doc.UniversalID, ,"UNID of last document"
End If
End Sub
2. 次の関数は文書を取得し、その文書の原典となる文書を返します。原典となる文書とは、返答文書の階層の起点となる主要文書です。この関数は、ディスカッションデータベースで返答への返答文書が何階層にも繰り返されている場合に便利です。
Function getAncestor ( doc As NotesDocument ) _
As NotesDocument
Dim view As NotesView
Set view = doc.ParentView
If Not(Doc Is Nothing) Then
While doc.IsResponse
Set doc = view.GetParentDocument( doc )
Wend
End If
Set getAncestor = doc
End Function
関連項目
GetParentDocument メソッド
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集