Solved

Notes richtext item. What happen?

Posted on 2001-07-25
10
1,424 Views
Last Modified: 2013-12-18
Hi,

I need to append text and a richtext item to a memo.
I've got something like this:

Set rtitem = New NotesRichTextItem( memo, "tmpBody" )
Set rtitem1 = New NotesRichTextItem( memo, "Body" )

Call rtitem.Appendtext(changedesc$)
Set descrtitem= currentdoc.GetFirstItem("ChangeDesc")
Call rtitem.AppendRTItem(descrtitem)
Call rtitem.Appendtext(changedesc$)
     
Call rtitem1.AppendRTItem(rtitem)

I couldn't see the content in the richtext item and the text appended thereafter.
However, when I look at the Body field in document properties, it's there.

Why can't I see in the email?


Thank You.
0
Comment
Question by:PinkDolphin
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 6316442
Did you save the document?
If you check the documents properties (fields), has tmpBody been added?

I had similar problems before in R4 once. I solved it by reading the NotesRTItem.text property after appending text/richtext/new lines to it. Strange but true....
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6317302
Instead of creating item, just get the handle to the item

Set rtitem = New NotesRichTextItem( memo, "tmpBody" )
Set rtitem1 = New NotesRichTextItem( memo, "Body" )

replace with

set rtitem = currentdoc.GetFirstItem("tmpBody")
set rtitem1 = currentdoc.GetFirstItem("Body")

~Hemanth
0
 

Author Comment

by:PinkDolphin
ID: 6317521
Yes, this is what I did.

use GetFirstItem, then use AppendRTItem

Set rtitem = New NotesRichTextItem( memo, "Body" )
Set descrtitem= currentdoc.GetFirstItem("ChangeDesc")

Call rtitem.Appendtext(changedesc$)
Call rtitem.AppendRTItem(descrtitem)

I thought this is straightforward. The funny thing is I can't see the content for AppendRTItem; can only see value of changedesc$. But when I go to the document properties, I can see the content for AppendRTItem in the Body field.



0
 

Author Comment

by:PinkDolphin
ID: 6317531
Oops...to add on.
when I say I can't see the content for AppendRTItem, I mean I don't see it when I open the email. But it is in the Body field in  document properties


0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6319406
How many body fields are listed in the document ???

I was refering to body item, if it is already available get the handle and if does'nt then create a new body item
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:PinkDolphin
ID: 6320455
I created a new body item in my memo document.

There is only 1 body field. I'm trying to append text, as well as another richtext item into this body field.

However, the content in the richtext item cannot be seen in the memo although the body field in the document properties shows the content.

Hope I've explained myself clear.

Thanks.



0
 
LVL 13

Accepted Solution

by:
CRAK earned 100 total points
ID: 6321070
Try something like:

Set rtitem = memo.GetFirstItem("Body")
Set descrtitem= currentdoc.GetFirstItem("ChangeDesc")

Call rtitem.Appendtext(changedesc$)
Call rtitem.AppendRTItem(descrtitem)

(not sure about the forms, but the GetFirstItem for the body-field should do the trick!)
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6321978
Don't append the text just appendrtitem and see if u can see the appended item.

& then

Try this

                     Set rtitem = New NotesRichTextItem( memo, "Body" )
                     Set descrtitem= currentdoc.GetFirstItem("ChangeDesc")

                     Call rtitem.Appendtext(changedesc$)
Call rtitem.AddNewLine(1,true)
                     Call rtitem.AppendRTItem(descrtitem)


Also check this
http://support.lotus.com/sims2.nsf/eb5fbc0ab175cf0885256560005206cf/14463992904c7cc48525636b004d273d?OpenDocument

0
 

Author Comment

by:PinkDolphin
ID: 6329001
Even if i just append the richtext item, the content is not displayed in the mail. However, you can see the value in the body field in document properties. i thought whatever is in the field in the document properties, you would be able to see on the form if the field is there. The body field is definitely on the memo form. How could it be hidden?

I tried exactly the same codes on another form. It works.

I'm thinking of re-creating the same form, but there are too many fields on the form, it will take a lot of time.

Experts out there, any idea? I'm at a loss, I wouldn't want to waste my time re-creating the form and try again.

Thank You.
 ~Desparate for help~

0
 
LVL 18

Expert Comment

by:marilyng
ID: 6447239
PinkD..
Just recently joined this exchange, so hadn't seen your note.  If a rich text item already exists on a document, you instantiate the rtitem as a variant, rather than a New Rich Text item, else you create another instance of the rtitem. (which is the one that you see in the properties, but doesn't show up on the form)

If its a new unsaved document, then you instantiate it as New Rich Text item, because the body field does not yet exist until the document is saved.

Whenever you update or add to a rt item, you have to close and open the document to see the changes.

Also, if the item exists, you can use standard item methods to append, unless you need to format the rich text in special ways with font colors, etc.

Hope this helps.
Marilyng

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now