Previous Document Next Document

Object Model Reference : Classes : D : DataFields : Methods : DataFields.Add


DataFields.Add

Function Add(Name As String, [Format As String], [AppDefault As Boolean = False], [DocDefault As Boolean = False], [SummarizeGroup As Boolean = False]) As DataField

Description

Member of DataFields

The Add method adds a data field.

Parameter
Description
Name
Specifies the name of the data field
Format
Specifies the format value of the data field. This parameter is optional.
AppDefault
Specifies the data field as a default field. This parameter is optional, and its default value is False.
DocDefault
Specifies the data field as a default field in the document. This parameter is optional, and its default value is False.
SummarizeGroup
Specifies whether to summarize the data field. This parameter is optional, and its default value is False.

VBA example

The following VBA example adds a new data field named Weight and specifies a custom data format (which displays two digits after the decimal point and places the kg suffix after the number).

Sub Test()
 ActiveDocument.DataFields.Add "Weight", "#,##0.00 ""kg""", False, True, False
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.