"Combine" NotesItem s

I am trying to process my document in a database that we deploy to users as part of an integration piece.Essentially I need to get the email address; this may have been entered by the user after the document was created, or more likely added as part of the integration with our CRM system.

It occours to me that the user could be using the To, CC or BCC field for the email address…

So I wrote some code like this:

Dim item As NotesItem

Dim E3MTo As NotesItem

Dim E3MCC As NotesItem

Dim E3MBcc As NotesItem

Set E3MTo = doc.GetFirstItem( “SendTo” )

Set E3MCC = doc.GetFirstItem( “CopyTo” )

Set E3MBcc = doc.GetFirstItem(“BlindCopyTo”)

If(E3MTo Is Not Nothing & E3MCC Is Not Nothing & E3MBcc Is Not Nothing) Then

Set Item = E3MTo And E3MCC And E3MBcc

If(GNDTo<>“” & GNDCC <>“” ) Then

Set Item = GNDTo & GNDCC

If(GNDTo<>“” & GNDBcc <>“” ) Then

Set Item = GNDTo & GNDBcc

If(GNDTo=“” & GNDCC <>“” & GNDBcc <>“” ) Then

Set Item = GNDCC & GNDBcc

If(GNDTo<>“” & GNDCC = “” & GNDBcc = “”) Then

Set item = doc.GetFirstItem(GNDTo)

If(GNDCC<>“” & GNDTo = “” & GNDBcc = “” ) Then

Set item = doc.GetFirstItem(GNDCC)

If(GNDBcc<>“” & GNDCC = “” & GNDTo = “”) Then

Set item = doc.GetFirstItem(GNDBcc)

End If

End If

End If

End If

End If

End If

End If

But it won’t compile, gives the error Type mismatch on GNDTo

On this line (it says): Set item = doc.GetFirstItem(GNDTo)

Although, most of the code is in Red so I don’t think any of its working…any ideas on how to get in one Item all three GetFirstItems for To, CC and BCC ?

Subject: What language are you using?

Is this supposed to be LotusScript?

Subject: RE: What language are you using?

Yes.

Subject: RE: What language are you using?

A number of issues, staring with:You never defined GNDTo, GNDCC, GNDBCC

You’ve totally reversed the usage of “AND” (combining IF conditions) and “&” (concatenating strings).

GetFirstItem takes a string (field name) as an argument.

“Set Item = E3MTo And E3MCC And E3MBcc” makes no sense at all.

Subject: RE: What language are you using?

Well, I am very rusty with LS I don’t right it anymore.

Is there a way to do what I want, or not?

Don’t worry too much though, I found an easier way of doing it by simply adding a field.