Hello,
I have an action button written in Lotus Script that loops through a bunch of documents in a view and creates an email message in the mail file of the person clicking the action. The action button formats the email message using documents and it’s formatted the way I need it.
The only other thing I would like to add is headings in the email message based on the begin date of the record in the view. So for example, my email report currently looks like this in the body field:
11/01/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
12/13/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
12/14/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
but I want it to look like this - notice I added the headings.
PAST EVENTS
11/01/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
UPCOMING EVENTS
12/13/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
12/14/2006 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
DATE TO BE DETERMINED
> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
It would seem that I need to use an If/Then/Elseif statement but what I can’t figure out is where to put the code and how to insert it so that the headers only print once no matter how many records fall under it.
Thank you in advance for any guidance!
Code - free typed so excuse typos. the code does work just need help with getting the headings in the email message : (
sub click(source as button)
declare variables to
establish rich text formatting
get mail file
get view
get view entry collection
etc
while not (doc is nothing)
rtpstyle.leftmargin = ruler_one_inch *1.5
rtpstyle.firstlineleftmargin = ruler_one_inch * 1.0
call rtitem.appendparagraphstyle(rtpstyle)
richstyle.bold = true
richstyle.fontsize = 12
richstyle.notesfont = rtitem.getnotesfont(“default sans serif”,true)
call rtitem.addnewline(2)
call rtitem.appendstyle(richstyle)
call rtitem.appendtext(doc.begindt(0))
call rtitem.appendtext(" ")
call rtitem.appendtext(doc.purpose(0))
call rtitem.appendtext(" ")
richstyle.bold = false
call rtitem.appendstyle(richstyle)
call rtitem.appendtext(doc.comment(0))
call rtitem.addnewline(1)
set doc = view.getnextdocument(doc)
wend
'open email with report
call maildoc.computewithform(false,false)
call ws.editdocument(true,maildoc
end sub