GetNumberStyle Method

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

Declaration

IWPNumberStyle IWPNumberStyle GetNumberStyle([In] int ID, [In] int Mode, [In] int Level);

Description

This method can be used to modify number styles. Usually the parameter ID will be passed as value 0.

 

In case you want to add a new style set, pass ID as -1.

Parameters

ID:If the ID is >0 a numberstyle will be selected by ID (WPAT_NumberStyle) and level (WPAT_NumberLevel).

 If Mode = -1000 the numberstyle (if one was found) will be deleted. If no style was found or the style was deleted the result value is null.

 If ID=-1 a new numbering style will be created. This style can be either a simple numbering style (Level=0) or an outline (Level between 1 and 9)

Mode:The numbering mode, possible values are:

0 : no numbering

1 : bullets

2 : circles (not used)

3 : arabic numbering 1,2,3

4 : captital roman

5 : roman

6 : capital latin

7 : latin

Special Mode: If ID>0 the value -1000 will cause the deletion of this style.        

LevelThis is the outline level between 1 and 9

 0 selects simple numbering (not nestable)

Returns

IWPNumberStyle reference or null if undefined.

 

You can also use it to modify the outline (level<>0)

 

Example:

IWPNumberStyle NStyle = rtF2PDF1.Memo.GetNumberStyle(001);

NStyle.ASet((int)WPAT.NumberMODE,1); // Make it Arabic 1. 2. 3. ...

rtF2PDF1.ReleaseInt(NStyle);

 

 

The value "ID" can be used with the property WPAT_NumberStyle in any paragraph.

 

Example - create custom bullets

 

          IWPMemo Memo = wpdllInt1.Memo;

          IWPAttrInterface Attr = Memo.TextAttr;

          IWPNumberStyle style;

           style = Memo.GetNumberStyle(-1,1,0); // Bullet

 

          if(style!=null)

           {

               style.TextA = "¢"; // after text = "."

               style.Font="WingDings";

               style.Indent = 360;

           }

           Attr.AttrSET((int)WPAT.NumberSTYLE, style.ID);

 

           wpdllInt1.ReleaseInt(style);

 

 

 

Note: Please don't forget to call ReleaseInt() with the returned interface at the end of your code.


[idh_iwpmemo_getnumberstyle.htm]    Copyright © 2007 by WPCubed GmbH