RTFDataAppendTo Method

[Top]  [Chapter]  [Previous]  [Next]


void RTFDataAppendTo([In, MarshalAs(UnmanagedType.BStr)] string Name, [In] int Options);


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


              // Make 30 copies

              for (int i = 0; i < 30; i++)


                   wpdllInt1.Memo.RTFDataAppendTo("LABELS", 1);


              // and display the label sheet


              // and activates label display

               wpdllInt1.Memo.LabelDef.Caption = "WPCubed GmbH";

               wpdllInt1.Memo.LabelDef.Active = true;



              // switch back to normal text




Please avoid to append the text to the source element (itself) - this causes the text to grow exponentially.



NameThe name of the destination RTF data element. Use any name or @@FIRST@@ for text in first editor and @@SECOND@@ for text in second editor (unless RTFDataSelect was used to display different element).
OptionsThis is a bit-field
1: Create a new page break before each copy
2: Don't copy merge fields
4: Don't copy bookmark tags
8: Don't copy images
64: Create a new section
128: assign page format of the source to the section
256: set the Reset-Outline-Numbers flag for the new section



Logical MDI Support


[idh_iwpmemo_rtfdataappendto.htm]    Copyright © 2007 by WPCubed GmbH