Hello all,
I’m desperately trying to create a lotuscript code that would forward an incoming message in a mailbox. This code has to be written in lotuscript because it would be called from within an existing “antispam” code (if mail is spam, do not forward and move to the “spam” folder - if mail is not spam, forward the message to the following people, configured through a Profile Document).
Formula Language is helpful (there is a command to forward a message), but nothing in LotusScript).
Thanks in advance…
Subject: How to forward a message using LotusScript
David,
If you get a handle on the document in script, use can then use the Send method of the NotesDocument class. There are all sorts of fields you can set on the document (SendTo, Principal etc etc). You could even copy the document as a new document.
I admit it is not as easy as using the :commands, but it can be done
HTH
Mike
Subject: How to forward a message using LotusScript
Hi,
have a look at this method of the NotesNewsLetter - Object:
Set notesDocument = notesNewsletter.FormatDocument( notesDatabase, n% )
Bye
Hynek
Subject: RE: How to forward a message using LotusScript
Tried this method… but how to use the “current document” in the Newsletter ?
Subject: RE: How to forward a message using LotusScript
Hi,
try this:
Dim Workspace As New NotesUIWorkspace
Dim tmpDocColl As NotesDocumentCollection
Dim UIDoc As NotesUIDocument
Dim Doc As NotesDocument
Dim tmpDoc As NotesDocument
Dim NewsLetter As NotesNewsletter
Set UIDoc = Workspace.CurrentDocument
Set Doc = UIDoc.Document
Set tmpDocColl = Doc.ParentDatabase.Search("@False",Nothing,0)
Call tmpDocColl.AddDocument(Doc)
Set NewsLetter = New NotesNewsletter(tmpDocColl)
Set tmpDoc = NewsLetter.FormatDocument(Doc.ParentDatabase,1)
'.....
Bye
Hynek