Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Notes richtext item. What happen?

Posted on 2001-07-25
10
Medium Priority
?
1,477 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

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!

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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