Columns

<< Click to Display Table of Contents >>

Navigation:  Programming > WPTools Premium >

Columns

WPTools Version 9 "Premium" supports columns.

 

 

Columns are controlled by the paragraph properties WPAT_COLUMNS and WPAT_COLUMNS_X.

WPAT_COLUMNS specifies the number of columns and  WPAT_COLUMNS_X the distance between.

 

Please note that "text balancing" is supported.

 

This code starts a 2 column layout at the current paragraph with 0.5 cm margin inbetween.

 

 WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS, 2);

 WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS_X, WPCentimeterToTwips(0.5));

 WPRichText1.Refresh;

 

This code will create 3 columns

 

 WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS, 3);

 WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS_X, WPCentimeterToTwips(0.5));

 WPRichText1.Refresh;

 

With this code a column break is inserted so this paragraph will be moved to next column or page. The user will need this functionality if a column should not be extended to the end of the page.

 

 include(WPRichText1.ActiveParagraph.prop, paprNewColumn);

 WPRichText1.Refresh;

 

To switch of column layout use

 

 WPRichText1.ActiveParagraph.ASet(WPAT_COLUMNS, 1);

 WPRichText1.ActiveParagraph.ADel(WPAT_COLUMNS_X);

 WPRichText1.Refresh;

 

Column properties are loaded and saved in WPT and RTF format.