Previous Document Next Document
DataFields.Add

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

Member of DataFields

The Add method adds a new data field.

Parameters
Description
Name
Sets the name of the data field
This value is a string value.
Format
Sets the format value of the data field
This parameter is optional.
AppDefault
Sets the data field as a default field
This parameter is optional, and its default value is False.
DocDefault
Sets 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.

The following code example adds a new data field named Weight and specifies a custom data format (2 digits after the decimal point and 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 2007 Corel Corporation. All rights reserved.