Lotus Notes代理编辑器中没有“脚本区域”

时间:2014-06-20 10:45:41

标签: lotus-notes lotusscript

我需要这里描述的功能:Determining which folder contains a document in Lotus Notes without using the LotusScript FolderReferences property

它说:“以及脚本区域中的以下代码”。但是没有脚本区域。有一棵树包含“文档选择”,“(选项)”,“声明”,“初始化”和“终止”。

1 个答案:

答案 0 :(得分:1)

您可以将该代码输入Initialize方法的主体。确保保留选择“初始化”时自动显示的代码,并在中间输入代码

Sub Initialize

    Dim session As New notessession
    Dim db As notesdatabase
    Dim doc As notesdocument
    Dim doc2 As notesdocument
    Dim view As notesview
    Dim noteid1 As String
    Dim noteid2 As String
    Dim item As notesitem
    Dim collection As notesdocumentcollection
    Set db=session.CurrentDatabase
    Set collection=db.UnprocessedDocuments
    Set doc=collection.getfirstdocument
    noteid1=doc.NoteID
    Forall v In db.Views

        If v.isfolder Then
          Set doc2=v.GetFirstDocument
          While Not doc2 Is Nothing
            noteid2=doc2.NoteID
            If noteid1=noteid2 Then
                Messagebox v.name
            End If
            Set doc2=v.getnextdocument(doc2)
          Wend
        End If

    End Forall

End Sub