GetNumberStyle Method

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


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


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.


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)


IWPNumberStyle reference or null if undefined.


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



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

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




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




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


               style.Indent = 360;


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






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