0 pts.
 Export of Email from Notes
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.

Software/Hardware used:
ASKED: September 5, 2006  6:58 AM
UPDATED: September 5, 2006  8:03 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  September 5, 2006  7:38 am  by  MHanson   35 pts.
All Answer Wiki Contributors:  MHanson   35 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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,075 pts.