Right after call AddNLTag() how can I get the correct ItemInfo? rve.GetCurrentItem?
Thanks
How to get newly inserted item
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to get newly inserted item
Add*** methods add items to the end of the document. So the index of the new item is rve.ItemCount - 1, and you can use rve.GetItem(rve.ItemCount - 1).
You cannot use GetCurrent*** methods. They work with the item at the position of the caret. This position is undefined until you format the document.
Note: AddText*** methods may add multiple items, if string contains line breaks, tabs, or page break characters. To calculate how many items are added, you can compare values of rve.ItemCount before and after the call.
You cannot use GetCurrent*** methods. They work with the item at the position of the caret. This position is undefined until you format the document.
Note: AddText*** methods may add multiple items, if string contains line breaks, tabs, or page break characters. To calculate how many items are added, you can compare values of rve.ItemCount before and after the call.