ITextPara::AddTab method (tom.h)

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

Syntax

HRESULT AddTab(
  [in] float tbPos,
  [in] long  tbAlign,
  [in] long  tbLeader
);

Parameters

[in] tbPos

Type: float

New tab displacement, in floating-point points.

[in] 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.

[in] 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

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