RTFDataAppendTo Method |
[Top] [Chapter] [Previous] [Next] |
Declaration void RTFDataAppendTo([In, MarshalAs(UnmanagedType.BStr)] string Name, [In] int Options); Description This method can be used to append the current text to an existing or new text buffer. The name of the buffer is specified as parameter one.
When you are done with the merging you can switch to the result buffer using RTFDataSelect.
This C# code copies the current text (it expects this to be an address, about 5 lines) 30 times - each one on a new page. Then it activates the other text and activates the label display for this text.
private void LabelEdit_Click(object sender, System.EventArgs e) { LabelEdit.Checked = !LabelEdit.Checked; if (LabelEdit.Checked) { // Delete the label text wpdllInt1.Memo.RTFDataDelete("LABELS"); // Make 30 copies for (int i = 0; i < 30; i++) { wpdllInt1.Memo.RTFDataAppendTo("LABELS", 1); } // and display the label sheet wpdllInt1.Memo.RTFDataSelect("LABELS"); // and activates label display wpdllInt1.Memo.LabelDef.Caption = "WPCubed GmbH"; wpdllInt1.Memo.LabelDef.Active = true; } else // switch back to normal text wpdllInt1.Memo.RTFDataSelect("@@FIRST@@"); }
Please avoid to append the text to the source element (itself) - this causes the text to grow exponentially.
Category |