Solved

Lotus notes - forward mails agent with these conditions in subject,

Posted on 2015-02-11
3
210 Views
Last Modified: 2015-02-11
Hi guys,

I urgently need some help, with a lotus agent/script that can forward mails from the inbox to a mailadress/mailgroup if it contains 2 specific word in the subject.

The user have restrictions to create the mail rule "send copy to" so sadly that's a option we do not have. The user are allowed to create agents in their mailbox

kindly advise.
0
Comment
Question by:Hakum
  • 2
3 Comments
 
LVL 1

Author Comment

by:Hakum
ID: 40602818
I found this code,

but i'm not sure how I add if it contains "AAAA" and "BBBB"

Sub Initialize
	Dim s As New NotesSession 
	Dim db As NotesDatabase 
	Dim doc As NotesDocument 
	Dim newdoc As NotesDocument 

	Set db=s.CurrentDatabase 
	Set doc=s.Documentcontext 
	Set newdoc = db.CreateDocument 

	Call doc.CopyAllItems(newdoc, True) 
newdoc.Subject="Fwd: "& newdoc.Subject(0) 
	newdoc.CopyTo="" 
	newdoc.BlindCopyTo="" 
	Call newdoc.Send(False, "XXXX@XXXX.com")
End Sub

Open in new window

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 40602883
Should be something like this:

Sub Initialize
	Dim s As New NotesSession 
	Dim db As NotesDatabase 
	Dim doc As NotesDocument 
	Dim newdoc As NotesDocument 

	Set db=s.CurrentDatabase 
	Set doc=s.Documentcontext 

	If Not(Instr(doc.Subject(0), "AAAA")>0 And Instr(doc.Subject(0), "BBBB")>0) Then
		Exit Sub
	End If

	Set newdoc = db.CreateDocument 

	Call doc.CopyAllItems(newdoc, True) 
	newdoc.Subject="Fwd: "& newdoc.Subject(0) 
	newdoc.CopyTo="" 
	newdoc.BlindCopyTo="" 
	Call newdoc.Send(False, "XXXX@XXXX.com")
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:Hakum
ID: 40602916
works like a charm thank you sooo much!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Recent Contacts - Lotus Notes 10 605
External emails not coming through 3 96
Bulk lotus notes account creation 3 68
lotus notes, exchange 7 105
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now