copy mail from one nsf to another Lotus notes

5 pts.
Tags:
Lotus Notes
NSF
I have a requirement of copying a mail from one NSF to another nsf file. Here first i created replica of database(nsf), Then i tried different way of copying mail. like 1. using CreateDocument API and then move it to speciified folder. 2. Creating new mail(Document) then adding each item one by one. And Bosy of the message added using RichText . then also am loosing my mail format. Means if there is any attachment, after copying it will loose its icon. Body format will be not in proper way. And also mail size ( In Form ) will be decreased. Please let me know what mistake am doing.
ASKED: November 19, 2008  1:36 PM
UPDATED: December 24, 2009  3:50 PM

Answer Wiki

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

are you trying to keep the emails with the original create date?
If not just copy & paste them from one mail file to another.
You can use the lostuscript notesdocument.copytodatabase method to copy the entire document to the new database.
IF you are trying to have duplicate copies in the new file, then you can use an agent to do dxl export then import into the new database. It will take some coding to make sure the fields are the same.

Discuss This Question: 11  Replies

 
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
  • SlikTool
    Brucelill is right, though it sounds like a document copy will work since you were using createdocument. Dim session as New NotesSession Dim db as NotesDatabase '(assuming it is running in the database where docs originate) Dim odb as NotesDatabase Dim view as NotesView Dim doc as NotesDocument Dim nvec as NotesViewEntryCollection Set db = session.currentdatabase Set odb = New NotesDatabase( dbServer, dbFilePath ) 'you need to specify other database where to copy to Set view = db.getview( "$Inbox" ) 'or whatever the view is that has the messages you want to move from Set nvec = view.allentries if nvec.count = 0 then exit sub end if For x = 1 to nvec.count
    1,840 pointsBadges:
    report
  • SlikTool
    ********DUPLICATION SORRY - ACCIDENTALLY SUBMITTED BEFORE FINISHING****** Brucelill is right, though it sounds like a document copy will work since you were using createdocument. Dim session as New NotesSession Dim db as NotesDatabase ‘(assuming it is running in the database where docs originate) Dim odb as NotesDatabase Dim view as NotesView Dim doc as NotesDocument Dim nvec as NotesViewEntryCollection Dim ventry as NotesViewEntry Set db = session.currentdatabase Set odb = New NotesDatabase( dbServer, dbFilePath ) ‘you need to specify other database where to copy to Set view = db.getview( “$Inbox” ) ‘or whatever the view is that has the messages you want to move from Set nvec = view.allentries if nvec.count = 0 then 'this makes certain their are documents (messages) to copy to begin with exit sub end if For x = 1 to nvec.count Set ventry = nvec.getnthentry(x) Set doc = ventry.document Call doc.copytodatabase( odb ) Next 'if necessary to then move the documents in the NVEC object Call nvec.PutAllInFolder( "otherFolderName" ) 'replace otherFolderName with the right folder name
    1,840 pointsBadges:
    report
  • Paia
    Hi, Thanks for replying. I wrote a small sample which basically copies mail from one NSF to another. Earlier i used createDocument and even CreateItem to copy mail, where format of mail was loosing. So i gone for Script where am able to retain all property of mail. But the new issue is, it will take lot of time to copy mail from one nsf to another. Like for a NSF having size 500 MB with 5600 mails, it will take around one and half an hour. So what i have to do so that i can reduce the copying time. Please let me know.. Here is the code (Script): Sub Initialize Dim session As New NotesSession Dim doc As NotesDocument Dim db As NotesDatabase Dim TargetDoc As NotesDocument Dim destinationDatabase As NotesDatabase Set destinationDatabase = New NotesDatabase("","LN_TARGET_DATABASE_PATH") Set db = session.CurrentDatabase "); Set doc = session.documentcontext "); Set TargetDoc = doc.CopyToDatabase(destinationDatabase) Call TargetDoc.PutInFolder("LN_TARGET_FOLDER") "); "TargetDoc.Save True,False "); "End Sub n"); I have an MFC Application where i will assign above code script to a string which i will write into NSF and then am executing the script thru Agent. Please let me know how can i increase the performance of my application.. Thanks in advance
    70 pointsBadges:
    report
  • Ledlincoln
    Paia (are you also Umeshpai?) from your response it sounds like you want to copy the whole database. If so, you can simply click File, Database, New Copy.
    1,620 pointsBadges:
    report
  • SlikTool
    As ledlincoln asked, is there a reason this must be done programmatically? For example, copy the file at the OS level. Then programmatically change the Replica ID of the database. Done, it is now a copy - not a replica. It will be a faster copy as well. If it does not need to be a programmed solution, do as LedLincoln said. I think you need the C API to change the replica ID, but there is a tool in the Lotus Sandbox that does it called Antrid I think. Mike K.
    1,840 pointsBadges:
    report
  • Paia
    Hi ledlincoln, My full name is Umesh Pai, and paia is my nick name. Thanks for your reply. but i have to do the mail copy thru pro grammatically. And also not entire database (NSF) , few mails from one nsf to another. And Mike, actually i need to copy few selected mails where i already enumerated Note ID for it. Since am using lotus script to copy these mails, its taking hell out of time. and if i use LN C++ APIs like createDocument(), then mails property is loosing ( but performance is faster ). Now my requirement is to copy selective mails with good time efficiency. Please let me know is there any way to improvise the performance. And also i will try out the solution which you have told. It may usefull for me in some scenarios. Thanks in advance...
    70 pointsBadges:
    report
  • Ledlincoln
    I guess you could go about it in reverse - copy the whole database, then delete any documents that don't match those on your NoteID list. Might be faster.
    1,620 pointsBadges:
    report
  • Paia
    Hi, I want to take back my words. Copying mails thou Lotus script is faster than copying it thru LN C++ APIs. I made a mistake, As you see my code for scripts in my earlier discussion, where i was executing the script thu an agent from My VC++ Application by passing an document as argument. And the same argument i was accessing in script like Session.Document context. So the script was getting executed for each document. Because of this copying was taking more time. Now what i want is to pass Document array as argument thru Execute call from agent. but i dont know how can i access the same document array from script. Please let me know how can i access a document array in a script which am passing as an input through LNAgent. Thanks in advance...
    70 pointsBadges:
    report
  • SlikTool
    If I understand correctly, you want to use the NotesDocumentCollection in LotusScript. This is a Document array that can be created document by document, from a targeted search (Full Text or Not), from selected documents, or from a view/folder. In addition, you can get a NotesViewEntryCollection from a view or folder and get the document from there. Either way, the issue is that you will still have to process it a document at a time from Lotus Script as I don't believe you can do a CopyAllToDatabase, just CopyToDatabase on a per document basis. Mike K
    1,840 pointsBadges:
    report
  • Paia
    Hi Mike, Actually my requirement is something like this. Thru a VC++ application am formating a string which is nothing but the source for script which am adding like LNLotusScript.SetSource(). Then thru an LNAGent am putting this script into NSF. Later i will access the same script thru agent using script title. Then i will execute the script thru agent. In my application ( VC++), i have all logic of reading mails/folders .. but in script simply am trying to move certain mails whose Universal Id am passing into an array while preparing script source. I have resolved my problem, where i wanted to know how can i pass these UniversalID as argument for scripts.
    70 pointsBadges:
    report
  • Malkoc
    I need to copy my some local mails to server db.I think that script can do that ,but I dont know how Can I write and run. I have got a nsf located my pc and I want to transfer some documents from local nsf to my server box. Please give me exact path and way to write and run it.
    15 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