Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Vera Minatexettu 23.Jul.03 11:08 PM a Web browser
Applications Development All Releases Windows 2000


Hi,

I wrote this agent that supposes to reply automatically using draft mail (stored in the Draft folder) if the newly arrived mail contains a certain wording on the Subject field. It works FINE when I test run it from the design mode (Agent-Run). Here is what I get when I do an Agent--Test :
***********
The following will occur when this agent is run:

'CN=Hung Tran/OU=XXXX/O=YYY' has restricted rights to run LotusScript/Java agents on 'CN=D01MLXXX/OU=01/OU=M/O=XXX'.
Allow restricted operations flag is selected in this agent, but will be ignored because the signer does not have unrestricted rights.
Agent will be run by the Router as each new mail is delivered.
Home mail server for 'CN=Hung Tran/OU=XXXX/O=YYY' is 'CN=D01MXXXX/OU=01/OU=M/O=YYY'. Note: If needed, agent may failover to another server.

Started running agent 'Send Reply_B' on 07/23/2003 05:16:34 PM
Running on new mail messages: 1 total
Testing: Ran LotusScript code
Done running agent 'Send Reply_B' on 07/23/2003 05:16:34 PM
****************
But set it for "After mail arrrives" or "Before mail arrives" , nothing happens when I send myself mail with that specified string in the Subject . Work fine if run manually. Arrrrgh..Oh how frustrating ! . Please help.

Here is the code :
************************
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc1 As NotesDocument 'incoming mail
Dim reply As NotesDocument
'Dim searchStr As String
'Dim searchDate As New NotesDateTime("07/05/56")
Dim dc As NotesDocumentCollection
Dim vc As NotesViewEntryCollection
Dim view As NotesView
Dim entry As NotesViewEntry
Dim nav As NotesViewNavigator
Dim item As NotesItem
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc1 = New NotesDocument(db)

'Search for mail with word PMMA in the subject
Dim Subject As String, SearchforString As String
Dim positionOfChar As Long
Dim found As Variant
Set doc1 = dc.GetFirstDocument
While Not(doc1 Is Nothing)
found = False
Subject =doc1.Subject(0)
SearchforString = "PMMA"
positionOfChar& = Instr(Subject$ , SearchforString$ )
'If found occurence of word PMMA in the subject line
If positionOfChar& <> 0 Then
Set view = db.GetView("($Drafts)") 'View that store the draft reply
Set nav = view.CreateViewNav
Set entry = nav.GetFirst
While Not(entry Is Nothing ) And Not found
Set reply = entry.Document 'Search for the draft
If reply.Subject(0) = "Public Sector PMMA" Then
reply.Form = "Memo"
reply.SendTo = doc1.From
reply.Send(True)
found =True
Else
Set entry = nav.GetNext(entry)
End If
Wend
End If
Set doc1 = dc.GetNextDocument(doc1)
Wend
End Sub
**************************************
I read and follow all the "Troubleshooting Agents" articles in the front page of this LDD website but still could not figure out what's wrong.

Any helps or hints are really appreciated . Many thanks in advance.






Agent set on "After mail arrives" n... (~Vera Minatexet... 23.Jul.03)
. . RE: Agent set on "After mail arrive... (~Holly Frokigen... 23.Jul.03)
. . RE: Agent set on "After mail arrive... (~Naomi Cisrelit... 24.Jul.03)
. . . . RE: Agent set on "After mail arrive... (~Holly Frokigen... 24.Jul.03)
. . . . RE: Agent set on "After mail arrive... (~Vera Minatexet... 24.Jul.03)
. . . . . . RE: Agent set on "After mail arrive... (~Holly Frokigen... 25.Jul.03)
. . . . . . . . RE: Agent set on "After mail arrive... (~Vera Minatexet... 25.Jul.03)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS