Export of Email from Notes

pts.
Tags:
Lotus Domino
LotusScript
I am trying to incorporate an Action button into Lotus Notes whereby clicking on it will export selected documents to the file system and run a script to transfer it to a remote server. My problem is two fold, i have added the button (to the inbox) and set it up to run a lotus-script routine. However, all examples i have found demonstrating how to gain access to the system by creating a new session object and opening up the database. I can find no reference to being able to acess the current view with its tick boxes. My second problem is then that there appears to be no method on the NotesDocument object for saving it out to a file/exporting the content. How is this achieved. This seems quite a simple request but i can find no other supporting help on the internet on this. Thanks in advance. Dave.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello DaveJB – examples exist in the notes help file for getting your collection of documents. You didn’t exactly say if you were looking to write them to ASCII or simply transfer them to another database. Here is a chunk of code that sets up your copytodatabase or export. Note: because mail messages can contain multiple objects (text, attachments, etc.) writing them to file takes a little planning. You need to learn the Notes RichTextItem class for this along with the Open method for writing to files.

dim s as new notessession
dim db as notesdatabase
dim dc as notesdocumentcollection
dim doc as notesdocument

set db = s.currentdatabase
set dc = db.unprocesseddocuments
Set doc = dc.getfirstdocument
While not doc is nothing
‘*** this is where you would do your export
‘ (see Open method)or your copytodatabase ***
set doc = dc.getnextdocument(doc)
end while

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BruceWayne
    If you want to export selected documents in "Inbox", you could code like this : '========================================================= Dim session as New NotesSession Dim ws as New NotesUIWorkSpace Dim uiview as NotesUIView Dim col as NotesDocumentCollection set uiview = ws.currentView set col = uiview.documents If not col is nothing then set doc = col.GetFirstDocument Do while not doc is nothing ' code here what you want to do in export process set doc = col.getNextDocument( doc ) Loop End if '======================================================= What will you do with exported emails ? In which system will you import them ? Depending on what you want to do with exported mails, you should have a look at this URL: http://searchdomino.techtarget.com/tip/1,289483,sid4_gci1190110,00.html?track=NL-598&ad=554289HOUSE
    4,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following