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 »

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: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to setItemText for an Item

Post by Sergey Tkachenko »

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