?
Solved

Notes richtext item. What happen?

Posted on 2001-07-25
10
Medium Priority
?
1,455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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 400 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

771 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