Solved

Notes richtext item. What happen?

Posted on 2001-07-25
10
1,413 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

17 Experts available now in Live!

Get 1:1 Help Now