ITextPara::AddTab method

Adds a tab at the displacement tbPos, with type tbAlign, and leader style, tbLeader.

Syntax


HRESULT AddTab(
  [infloat tbPos,
  [inlong  tbAlign,
  [inlong  tbLeader
);

Parameters

tbPos [in]

Type: float

New tab displacement, in floating-point points.

tbAlign [in]

Type: long

Alignment options for the tab position. It can be one of the following.

ValueMeaning
tomAlignLeft

Text is left justified from the tab position. This is the default.

tomAlignCenter

Text is centered on the tab position.

tomAlignRight

Text is right justified from the tab position.

tomAlignDecimal

The decimal point is set at the tab position. This is useful for aligning a column of decimal numbers.

tomAlignBar

A vertical bar is positioned at the tab position. Text is not affected. Alignment bars on nearby lines at the same position form a continuous vertical line.

 

tbLeader [in]

Type: long

Leader character style. A leader character is the character that is used to fill the space taken by a tab character. It can be one of the following.

ValueMeaning
tomSpaces

Spaces are used. This is the default.

tomDots

Dots are used.

tomDashes

A dashed line is used.

tomLines

A solid line is used.

 

Return value

Type: HRESULT

If ITextPara::AddTab succeeds, it returns S_OK. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see Error Handling in COM.

Return codeDescription
Value

Meaning

E_ACCESSDENIED

Write access is denied.

E_OUTOFMEMORY

Insufficient memory.

CO_E_RELEASED

The paragraph format object is attached to a range that has been deleted.

 

Remarks

It is assumed that there is never a tab at position zero. If multiple paragraphs are described, the common subset of tabs will be returned with 0x8000 in the upper word of the tab type.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextPara
ClearAllTabs
DeleteTab
GetListTab
GetTab
GetTabCount
SetListTab
Conceptual
Text Object Model

 

 

Show: