Add a neme to an authors field using LotusScript

Folks,I would be grateful if some one could give me the code needed to add a name to an authors field in LotusScript. The field is set up to allow multiple value but I wish to append another name. I know this is straignt forward in formula but I can not find the solution in LS.

Any help is appreciated.

Paul

Subject: Add a neme to an authors field using LotusScript

Hada a similar problem myself a while back. Hope this is of some use:

'get your target doc and run this against it

Dim x As Integer

Dim rdrarray() As String 'declare a temporary array to hold your existing readers field data

x = 0

Redim rdrarray(Ubound(doc.YourReaderField) + 1) 'make your temp array 1 element larger than existing reader array

Forall readers In doc.YourReaderField 'populate the temp array with the contents of your reader field

rdrarray(x) = doc.YourReaderField(x)

x = x + 1

End Forall

catarray(x) = “your new reader name” 'add you new reader name at the end of the temp array

doc.YourReaderField = rdrarray 'populate your reader field with the contents of your temp array

'set the YourReaderField field as a ‘Readers’ field

Dim rdrfield As NotesItem

Set rdrfield = doc.GetFirstItem(“YourReaderField”)

rdrfield.IsReaders = True

Call doc.Save( True, True ) 'save the form

Subject: RE: Add a neme to an authors field using LotusScript

Many thanks Derek. That worked a treat!!!

Subject: RE: Add a neme to an authors field using LotusScript

Glad it helped.