Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Simple Out of Office agent

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#OutOfOffice or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/OutOfOffice


A company I worked for did not have an out of office agent. i was asked to switch it on for the previous developer. It is usually under tools in the menus. I knocked up this code and put it in a "after new mail has arrived" agent.





 The agent should be set up by a ddesigner.

 ' Simple Out of Office or Employee has left agent.

 ' copyright Adam Foster

 ' Can be republished only with permission of Adam Foster

 ' See http://www.NotesNinjas.com/#OutOfOffice for latest version and help

 Dim  s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase

Dim col As notesdocumentcollection
Set col = db.unprocesseddocuments

Dim mdoc As New notesdocument(db)

Dim doc As notesdocument
Set doc = col.getfirstdocument()
Do Until doc Is Nothing
 
 Set nextdoc = col.getnextdocument(doc)
 If doc.hasitem("AdamOOO")=False Then
  'ok not sent before
  mdoc.sendto=doc.from(0) 'set the destination back to who sent it
  mdoc.blindcopyto="Adam Foster" ' add a bcc if required
  mdoc.subject="Geoff has left please contact Key users. RE:" & doc.subject(0)
  Call mdoc.send(False)
  doc.AdamOOO="Sent " & Now
  Call doc.save(False,False)  
 End If
 Set doc = nextdoc
Loop

 

The agent is very simple but it works.

 

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Web Services Platform Architecture: Soap, WSDL, WS-Policy, WS-Addressing, WS-Bpel, WS-Reliable Messaging and More by Francisco Curbera, Frank Leymann, Tony Storey, Donald Ferguson, Sanjiva Weerawarana
Other books claim to present the complete Web services platform architecture, but this is the first one I've seen that really does. The authors have been intimately involved in the creation of the architecture. Who better to write this book?
See at: Amazon.co.uk | Amazon.com |