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.

 

Parameters:

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

 

Category

Logical MDI Support

Mailmerge


[idh_iwpmemo_rtfdataappendto.htm]    Copyright © 2007 by WPCubed GmbH