Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing all values from a Name Field to another

Status
Not open for further replies.

saecsens

Programmer
Aug 5, 2003
21
0
0
CA
I need to pass all the name that are in the name field "invites" to another name field called "CopyTo", but I'm not very familliar with LS so I don't know how to do.. I tried
UIDoc2.FieldSetText("SendTo",uidoc.document.invites)
and
UIDoc2.FieldSetText("SendTo",Cstr(uidoc.document.invites))
but is says Type mismatch...
I tried also waht I use to do in VB, a For loop
For i = 0 To uidoc.document.invites
var = var + Cstr(uidoc.document.invites(i)) + ","
Next
but again it didn't work.
How can I do that transfer between my 2 Name field ??
 
no they aren't on the same form
Dim w As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = w.CurrentDocument
Dim i As Integer
Dim var As String
Dim UIDoc2 As notesUIDocument
Set UIDoc2 = w.ComposeDocument("","","Courrier")
'Remplir les champs du courriel
var = ""
For i = 0 To uidoc.document.les_membres
var = var + Cstr(uidoc.document.les_membres(i))
Next
Call UIDoc2.FieldSetText("SendTo",var)
Call UIDoc2.FieldSetText("EnvoyerPar",session.username)
var = ""
For i = 0 To uidoc.document.invites
var = var + Cstr(uidoc.document.invites(i))
Next
Call UIDoc2.FieldSetText("CopyTo",var)
Call UIDoc2.FieldSetText("Sujet","Rappel, votre réunion du " + Cstr(uidoc.document.date(0)))
Call UIDoc2.GotoField( "Body" )

I hope the situation is a little bite more clear ;)
 
You already have UIDOC initialized so the UIDOC.Document is not needed. UIDOC.Les_members should work. That would be the same for the rest of the fields too. Check the NotesUIDocument class in the help. That should give you better explanation.

Patou812
Lotus Notes Amdinistrator
 
that was not my problem really. My problem is passing all the values of the Name field. I can pass them one by one that way :

uidoc.document.les_membres(0) for exemple

so if I have to pass all thoses values, I need to know how many of them I have to pass, so I can do a simple For like this one :

For i = 0 To uidoc.document.les_membres
var = var + Cstr(uidoc.document.les_membres(i))
Next

but I need to know how to get the number of elements
I hope my explanations are better this time
 
Try a forall statement
ListA = Cst(uidoc.document.invites)
ForAll x In var
UIDoc2.FieldSetText("SendTo"ListA(X),)
End ForAll

Something like that.... This has not been tested. Check the logic

But I think the Forall stmnt should work for you.

Patou812
Lotus Notes Amdinistrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top