Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

lotus notes agent to move incoming mail to folder (based on part of subject)

Posted on 2009-04-07
4
Medium Priority
?
1,328 Views
Last Modified: 2013-12-18
i would like to have an agent that moves an incoming mail to a folder,
but only mails that contain a certain text in the mail body.
other mails will stay in the inbox or will be ove to another folder based on another text.

eg. when the subject contains the text '52.9 ritverzamellijst', the incoming mail should be moved to the same folder '52.9 ritverzamellijst'.
i tried with the attached code, but apparently there's something wrong with the routines that find the text in the body, because the mail stays in the inbox and is not moved.

any expert can fix this code ?
Sub Initialize
	Dim s As New NotesSession
	Dim doc As NotesDocument
	Dim it  As NotesItem
	Dim SPAM As String
	myident = "52.9 ritverzamellijst" ' make this your identifier 
	Set doc = s.documentcontext
	
	Print "Processing " & doc.subject(0) " from " & doc.From(0)
	Set it = doc.GetFirstItem("Body")
	If it Is Nothing Then
		Print "Exiting"
	Else
		Dim stringMyIdent
		stringMyIdent = it.Text
		If Instr( stringMyIdent, myident ) > 0 Then
			Call doc.PutInFolder("52.9 ritverzamellijst", False )
			Print "--> moving to folder  ---"
			Call doc.RemoveFromFolder( "($Inbox)" )
			Print "--> removing from inbox ---"
		Else
			Print "--> does not contain 52.9 ritverzamellijst ---"
		End If
	End If
End Sub

Open in new window

0
Comment
Question by:Lieven Embrechts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:daj_uk
ID: 24086336
Would it not be simpler to use a mail rule?  As this feature is already built into the mail template

0
 
LVL 9

Author Comment

by:Lieven Embrechts
ID: 24086376
a mail rule on mail BODY ?  i use notes 7.0.2.
0
 
LVL 5

Accepted Solution

by:
daj_uk earned 2000 total points
ID: 24086400
yes, see attached screen shot...
screen.jpg
0
 
LVL 9

Author Comment

by:Lieven Embrechts
ID: 24088176
yup, it's already solved.
i forgot there's something like 'mail rules' next to 'quick rules'.
or i need glasses...
thanks for your quick help !
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question