How to setItemText for an Item

General TRichView support forum. Please post your questions here
Post Reply
cychia_n2n
Posts: 16
Joined: Mon May 09, 2016 9:16 am

How to setItemText for an Item

Post by cychia_n2n » Tue Feb 28, 2017 10:05 am

I have a list to keep Text Items with special tag i have assigned to when calling AddNLTag. When I need to update the Item text, i will loop through my list and update item text one follow by another.

I tried, rve.SetItemText(rve.GetItemNo(TextItem), 'updated text'), but items in table cell does not seems to be working.

What is the best way to update Item's Text?

Thanks.

Sergey Tkachenko
Site Admin
Posts: 14562
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to setItemText for an Item

Post by Sergey Tkachenko » Tue Feb 28, 2017 11:07 am

Items in table cells cannot be accessed as rve.GetItem(). They belong to items of a cell, not of the root document.
You need to store two values: ItemNo and RVData.
For the root document, RVData = rve.RVData
For cell, RVData = Cell.

Code for changing cell:
RVData.GetRVData.SetItemText(ItemNo, 'updated text');

Post Reply