Hello fellow peeps, My code below works…it grabs the rich text from a document and puts it into the body of an email I am sending out automatically via a specified view…because this view has all the email addy’s in it that I want.
But…what is also stored in this view that has email addy’s are some codes that I need to send out with the email as well. I have been trying all sorts of append item and append rich text, but run into some class issues.
I’m a little we behind the ears when it comes to LS, but i’m learning…well, I did the below code!
Now I just need to grab the codes from the docs and put them into the separate emails and i’ll be good.
Any ideas? I’m searching and trying things and will post back if I fix.
Thank you so much in advance!
P.S. the Profile2 view is the view that stores the email addy’s and the codes. 1 form with 2 fields on it.
start code here
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim db2 As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim itemA As NotesItem
Set db = session.CurrentDatabase
Set db2 = New NotesDatabase( "<servername here>", "<maildb>.nsf" )
Set view = db.GetView("Profile2")
Set view2 = db.GetView("EmailBody")
Dim maildoc As New NotesDocument(db2)
Set doc = view.GetFirstDocument
Set doc2 = view2.GetFirstDocument
Set itemA = doc2.GetFirstItem( "EmailBody" )
Call itemA.CopyItemToDocument( maildoc, "Body" )
While Not(doc Is Nothing)
'send it
maildoc.Principal = "Perry W. Craig <pwcraig@ralcorp.com>"
maildoc.Subject = "Intranet Announcement & Policy Acknowledgment: ACTION REQUIRED"
maildoc.Form = "Memo"
Call maildoc.Send(False, doc.emailaddy)
Set doc = view.GetNextDocument(doc)
Wend
End Sub
end of code*