views:

347

answers:

2

Hi,

I want to programaticaly change some values to NSF item and then want to save it.(i.e to edit NSF File and then save the editions)

for example:

I want to set Sender name of all mails to "[email protected]".(Using Domino.dll).

Solution I tried: (Swaping of To and From values)

String Temp_From = ((object[])docInbox.GetItemValue("From"))[0] as String; String Temp_SendTo = ((object[])docInbox.GetItemValue("SendTo"))[0] as String; docInbox.ReplaceItemValue("From", Temp_SendTo); docInbox.ReplaceItemValue("SendTo", Temp_From); docInbox.Save(true, false, false);

/* Applied for following fields also:

For From: AltFrom,DisplayFrom,DisplayFrom_2,dspFrom,ForwardedFrom,INetFrom,tmpDisplayFrom

For To : displaySendTo,EnterSendTo,Envelope_to,tmpDisplaySendTo

Also Tried for saving : docInbox.Save(true, true, true); */

In above code after successful editing changes values are not reflected in Nsf File. But when i am reading edited Nsf (copying modified file on different location ) file programatically it is showing changed values.(Why changes are not visible here ?)

A: 

The "Programming Guide, Volume 2: LotusScript/COM/OLE Classes" can be found here: http://www-12.lotus.com/ldd/doc/uafiles.nsf/docs/DESIGNER70/

As brief summary, though, once you have a handle to a Document, you can iterate over all of the existing fields ("items") on that document using the Items property; and you can update a given field on that document using the ReplaceItemValue and/or AppendItemValue methods.

Ed Schembor
A: 

Are you checking the result with the Notes client? I guess this behavior could be explained by the client's rather aggressive caching. Try removing the file cache.ndk from the data directory before you check the result of your program.

Also, a Notes "Item" typically contains an array of values - your approach to swapping the SendTo and From fields will loose data if for example a mail has been sent to several people. Try copying the entire object[] instead.

Anders Lindahl