I am attempting to create an in-view action button that grabs the email addresses from all selected documents. The action would then create a new memo and insert the addresses into the BCC field. Does anyone have any samples or advice? Thanks in advance.
Update:
Honestly, the looping and adding to memo is stumping me a bit. I don't program that much these days. I'm including code below (I know something's missing). I want to limit the # of emails to 100, hence the who,x part. Any guidance appreciated. I want to use "who" as the value for blindcopyto. The user should be able to interact with the form vs. back-end mail send.
***I'm getting you must provide an item name from the start.
***The doc has 3 possible email addresses (in many cases #2 and #3 are blank).
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim adoc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set adoc = collection.GetFirstDocument()
Dim who, x
Do Until adoc Is Nothing
who = ""
For x = 1 To 100
who = who & adoc.GetItemValue("Email1")(0) & ";" & adoc.GetItemValue("Email2")(0) & ";" _
& adoc.GetItemValue("Email3")(0) & ";"
Print "Adding 100 email addresses (please wait)"
Set adoc = view.GetNextDocument(adoc)
If adoc Is Nothing Then Exit For
Next
who = Fulltrim(Split(who, ";"))
If Not (adoc Is Nothing) Then
Set adoc = view.GetNextDocument(adoc)
End If
Loop
Dim mdoc As NotesDocument
Set mdoc = New NotesDocument( db )
mdoc.Form = "Memo"
mdoc.blindcopyto = who
mdoc.Subject = "Test"
mdoc.Body = "Test"
' insert mail send here (removed for testing).
End Sub