IWP_ParagraphStyle Interface 

The IWP_ParagraphStyle interface defines public methods that set and get properties for the document's paragraph styles.  The methods for IWP_ParagraphStyle are categorized as follows:
 

 

Text Attributes

The following methods set text attributes such as font, bold, strikethrough, italic, underline, etc.
 
 
Return Function Call Description
void setBold(boolean on) sets text bold
boolean isBold() returns true if bold is on
void setItalic(boolean on) sets text italic
boolean isItalic() returns true if italic is on
void setUnderline(boolean on) sets text underline
boolean isUnderline() returns true if underline is on
void setStrikeThrough(boolean on) sets text strikethrough
boolean isStrikeThrough() returns true if strikethrough is on
void setProtected(boolean on) sets text protect
boolean isProtected() returns true if protect is on
void setFontName(String name) sets the font name
String getFontName() returns the font name
void setFontSize(int size) sets the font size
int getFontSize() returns the font size
void setTextColor(Color c) sets text color
Color getTextColor() returns text color
 

Margins

The following methods set text margins.
 
Return Function Call Description
int getLeftMargin() returns the left margin
void setLeftMargin(int margin) sets the left margin
int getRightMargin() returns the right margin
void setRightMargin(int margin) sets the right margin
int getBottomMargin() returns the bottom margin
void setBottomMargin(int margin) sets the bottom margin
int getTopMargin() returns the top margin
void setTopMargin(int margin) sets the top margin
 

Indents and Alignment

The following methods set indentation amounts and alignment.
 
Return Function Call Description
void setAlignment(String align) sets the text alignment -- left, center, right, or justified
String getAlignment() returns the text alignment
void setTextIndent(int mar) sets the text indent
int getTextIndent() returns the text indent
 

Line Height

The following methods set and return line height.
 
Return Function Call Description
void setLineHeight(int height) sets the line height, in pixels or percent, where 0 causes lines to be spaced according to font metrics, a negative number indicates that the number is a percent of font metrics height, and a positive number causes lines to be the specified number of pixels apart
int getLineHeight() returns the line height
 
 

Bullets and Leaders

The following methods set bullet and leader types and set indent values for text containing bullets or leaders.
 
Return Function Call Description
void setLeaderType(String leader) sets the leader type, where the valid types are as follows: 
"bullet"      - must also call setBulletChar 
"image"     - must also call setImageName 
"numeric"  - should also call setNumericType 
"outline"
String getLeaderType() returns the leader type
void setBulletChar(char bulletchar) sets the bullet character, where 0x25cf (disc), 0x25cb (circle) and 0x25a0 (square) are the allowed values
char getBulletChar() returns the bullet character
void setImageName(String url) sets the leader image
String getImageName() returns the leader image's name
void setNumericType(String type) sets the type of numbering, where the allowed values are decimal, 
lower-roman, upper-roman, lower-alpha or  upper-alpha
String getNumericType() returns the numeric type
void setSpaceBefore(int amt) sets the space before the bullet
int getSpaceBefore() returns the space before the bullet
void setSpaceAfter(int amt) sets the space after the bullet
int getSpaceAfter() returns the space after the bullet
void setAbsoluteSpace(int amt) setss the absolute amount of space the bullet should take up
int getAbsoluteSpace() returns the absolute space
void setTextBefore(String before) sets the text that is to appear before the bullet/number
String getTextBefore() returns the text that is to appear before the bullet/number
void setTextAfter(String after) sets the text that is to appear after the bullet/number
String getTextAfter() returns the text that is to appear after the bullet/number
 
 

Naming

The following methods are from IWP_Base and can be used on an IWP_ParagraphStyle object, because IWP_ParagraphStyle extends IWP_Base.
 
Return Function Call Description
String getName() returns the paragraph style's name
void setName(String name) sets the paragraph style's name

See Also
WordProcessor Overview