caption Property

Returns an IHTMLTableCaption object that represents a CAPTION element in a table.

expression.caption

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Example

The following example adds a CAPTION element to the first table in the active document and sets the caption text.

Dim objTable As FPHTMLTable
Dim objCaption As FPHTMLTableCaption

Set objTable = ActiveDocument.all.tags("table").Item(0)
objTable.insertAdjacentHTML "afterbegin", "<caption></caption>"

Set objCaption = objTable.Caption
objCaption.innerText = "Table Caption Text"

Applies to | FPHTMLTable Object | IHTMLTable Object