I want to be able to delete a part of a document between two controls I've added into the document. This part is an optional part of the document, so I've got to be able to switch it off.
If the optional part is not in a table, I've got it working. But it is also possible that an optional part of a document is in a cell of a table. How can I do a selection of that part (SetSelectionBounds) where after I can possible delete it.
My strategy is first to iterate over all the items with EnuItems. When I encounter the starting and closing control, I save their ItemNo (lStart and lEnd) and use them to do a SetSelectionBounds and deleting the selection:
Code: Select all
lRichView.SetSelectionBounds(lStart, 0, lEnd, 1); ... lRichView.DeleteSelection; lRichView.Format;