SetParType Method

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

Applies to

IWPParInterface

Declaration

procedure SetParType(ParType: Integer);

Description

Modify the paragraph type. Currently You can use the values:

0 : Standard paragraph

6 : Table parent - holds rows

7 : Table row - holds cells

16: This is a special "sub-paragraph". Its text will be displayed as one line but the cursor can never move to the paragraph. Instead all new text paragraph are entered as children of this paragraph.

 

The .NET assembly defines the enum "ParagraphType".

 

Example: Create sub paragraphs

 

          IWPMemo Memo = wpdllInt1.Memo;

          IWPTextCursor Cursor = Memo.TextCursor;

 

           Memo.Clear(true, true);

 

           Cursor.InputParagraph(4, ""); // Append a paragraph

           Memo.CurrPar.SetParType(16); // Sub Paragraph

           Memo.CurrPar.ParStrCommand(4, 0, "AAA"); // this is the name

           Memo.CurrPar.SetText("Headline 1",0); //CharAttr is ignored

           Memo.CurrPar.LoadFromString("{\\rtf1{Initial text for this \\b paragraph\\b0 .}","",0);

 

           Cursor.InputParagraph(4, ""); // Append a paragraph

           Memo.CurrPar.SetParType(16); // Sub Paragraph

           Memo.CurrPar.ParStrCommand(4, 0, "BBB"); // this is the name

           Memo.CurrPar.SetText("Headline 2",0); //this is the displayed text

           Memo.CurrPar.LoadFromString("{\\rtf1{Initial text for this \\b paragraph\\b0 .}","",0);

 

           Cursor.CPPosition = 0;

           Memo.ReformatAll();

 

You can use Memo.TextCommandStr(42, 4, "AAA") to move to a certain paragraph. Now you can use CurrAttr.LoadFromString or SaveToString.

 

Category

Table Support


[idh_iwpparinterface_setpartype.htm]    Copyright © 2007 by WPCubed GmbH