This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Apr 1, 2016, 4:20 PM
21 Posts

can't insert into the body of a new memo

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 4

I'm trying to insert text into a memo form ( contains field called body). and email it...
​Using simple text, it works and the email body is visible, but using any type of rtItem stuff.. it's either totally blank or ignores the new line stuff
​Can anyone tell me what in the heck I'm doing wrong...?

Dim s As New NotesSession
 Dim db As NotesDatabase
 
 Dim maildoc As NotesDocument
 Dim rtItem As NotesRichTextItem
  
 Dim emplist() As String 
 Dim i As Integer
 Dim z As Integer
 
 'JUST A PLACE HOLDER ARRAY TO TEST WITH 
 ReDim Preserve emplist(0)
 emplist(0) = "06900%Company A%Test,Brett%Test of something or another%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1997%"
 ReDim Preserve emplist(1)
 emplist(1) = "06901%company A%Test,Bill%Test Manager of Bill Solutions%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1996%"
 ReDim Preserve emplist(2)
 emplist(2) = "06902%Company A%Test,Ted%Test Manager of Ted Solutions%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1995%"
 
 Set db = s.Currentdatabase
 Set maildoc = db.Createdocument()
 Set rtItem = New NotesRichTextItem (maildoc, "Body") 
  
 maildoc.Form = "EmailNoticePlain"
 maildoc.From = "MisTools"
 maildoc.Subject = "Employee List"
 maildoc.saveOptions = "0"
 maildoc.SendTo = "Brett Flagg/SOME_NOTES"
 

'maildoc.Body = "this is a test"  '< this works...

 %rem
 this whole loop seems to ignore what i'm tring to do.. append line, insertnew data, loop...... 
 %end Rem

 z = 0
 For z = 0 To UBound(emplist)  
  rtItem.Addnewline(1)
  rtItem.Appendtext(empList(z)& Chr(10) & Chr(13))    ' Tried with and with out the chr() and variations thereof..
 Next
 
 Call maildoc.send(True)
​end sub

 

 

Apr 1, 2016, 4:56 PM
202 Posts
try using Call
 z = 0
For z = 0 To UBound(emplist)  
       Call rtItem.Addnewline(1)
       Call rtItem.Appendtext(empList(z)& Chr(10) & Chr(13))    ' Tried with and with out the chr() and variations thereof..
Next
Apr 4, 2016, 12:35 PM
82 Posts
Works fine for me
I removed the chr(13) chr(10) because not necessary and changed the form to Memo so I could see in my mail file and got this result.  Is there something funky about the Body field on your EmailNoticePlain field (ie. is it not rich text?)

Employee List




Bob McGrath   to: Bob McGrath
04/04/2016 08:34 AM




This message is digitally signed.





06900%Company A%Test,Brett%Test of something or another%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1997%

06901%company A%Test,Bill%Test Manager of Bill Solutions%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1996%

06902%Company A%Test,Ted%Test Manager of Ted Solutions%Management Information Systems%CN=John Doe/O=SOME_NOTES%05/14/1995%
Apr 4, 2016, 4:17 PM
323 Posts
I can suggest something ...

before you send the email, try a rtitem.Update() call.

Hey, sometimes it works for me.

Apr 12, 2016, 1:01 PM
1 Posts
New reply to: can't insert into the body of a new memo

As has been said above I always use "Call" for the rtitem statements you are using and also use memo for the name of the mail form first to make sure it works before using any other design of mail form.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal