Object Model Reference : Classes : D : DataFields : Methods : 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 data field.
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 |
Copyright 2013 Corel Corporation. All rights reserved.