「メールが到着する前に」でLotusscriptエージェントを実行しています。件名の「#」記号の後のテキストを取得するために必要です。件名フィールド(Evaluate、getFirstItem、getItemValueなど)をどのように取得しようとしても、常にエラーが発生します。通常、タイプの不一致またはオブジェクト変数が設定されていません。
以下のコードは私の現在のコードであり、14行目の「タイプの不一致」にエラー13を返します。
Option Public
Option Declare
Sub Initialize
On Error GoTo ErrorHandler
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesDocumentCollection
Dim doc As NotesDocument
Dim nextdoc As NotesDocument
Dim result As String
Set db = s.CurrentDatabase
Set view = db.Unprocesseddocuments
If Not view Is Nothing Then
Set doc = view.Getfirstdocument()
While Not doc Is Nothing
result = Evaluate ("@Right(Subject;""#"")", doc)
Print result
Set nextDoc = view.GetNextDocument(doc)
Call doc.Remove(True)
Set doc = nextDoc
Wend
End If
Print "End"
Done:
Exit Sub
ErrorHandler:
Select Case Err
Case Else
Print "Error " & CStr(Err) & " in agent on line " & CStr(Erl) & ": " & Error
Resume Done
End Select
End Sub