CPMoveNextRow Method |
[Top] [Chapter] [Previous] [Next] |
Applies to Declaration function CPMoveNextRow(CreateIfNotExist: WordBool): WordBool; Description Move to next row in this table. If the cursor is at the end of a table, optionally a new row can be created by duplicating the current row.
The text in the row is not duplicated unless the mode DuplicateWithText has been activated using Memo.SetBProp(18,1);
Example:
IWPMemo Memo; Memo = WPDLLInt1.Memo; IWPTextCursor TextCursor = Memo.TextCursor;
// Only one row TextCursor.AddTable( "data", 3, 1, true, 0, // EventParam =0, no event! false,// create header rows false // create footer rows ); // append rows for (int r = 0; r < 10; r++) { // Create new row - if not in first if (r > 0) TextCursor.CPMoveNextRow(true); // and create the text for (int c = 0; c < 3; c++) { TextCursor.CPTableColNr = c; TextCursor.InputText("some text"); } } TextCursor.InputParagraph(2, ""); //mode=2 --> after table! Memo.Reformat();
If you want to protect cells use this code:
IWPParInterface Par = Memo.CurrPar; Par.ParASet((int)WPAT.ParProtected, 1); Category |