Field.Data Property

Word Developer Reference

Returns or sets data in an ADDIN field. Read/write String.

Syntax

expression.Data

expression   A variable that represents a Field object.

Remarks

The data is not visible in the field code or result; it is only accessible by returning the value of the Data property. If the field isn't an ADDIN field, this property will cause an error.

Example

This example inserts an ADDIN field at the insertion point in the active document and then sets the data for the field.

Visual Basic for Applications
  Dim fldTemp As Field

Selection.Collapse Direction:=wdCollapseStart Set fldTemp = _ ActiveDocument.Fields.Add(Range:=Selection.Range, _ Type:=wdFieldAddin) fldTemp.Data = "Hidden information"

See Also