ITextPara::AddTab method

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

Syntax

HRESULT AddTab(
  float tbPos,
  long  tbAlign,
  long  tbLeader
);

Parameters

tbPos

Type: float

New tab displacement, in floating-point points.

tbAlign

Type: long

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

Value Meaning
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

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.

Value Meaning
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 code Description
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]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

ClearAllTabs

Conceptual

DeleteTab

GetListTab

GetTab

GetTabCount

ITextPara

Reference

SetListTab

Text Object Model