Value Property

Applies To

AutoCorrectEntry object, AutoTextEntry object, CheckBox object, DropDown object, MailMergeDataField object, ReadabilityStatistic object, Variable object.

Description

AutoCorrectEntry, AutoTextEntry, or Variable object: Returns or sets the value of the AutoCorrect entry, AutoText entry, or document variable. Read/write String.

CheckBox object: True if the check box is selected. Read/write Boolean.

DropDown object: Returns or sets the number of the selected item in a drop-down form field. Read/write Long.

MailMergeDataField object: Returns the contents of the mail merge data field for the current record. Use the ActiveRecord property to set the active record in a mail merge data source. Read-only String.

ReadabilityStatistic object: Returns the value of the grammar statistic. Read-only Single.

Example

This example adds a document variable to the active document and then displays the value of the new variable.

ActiveDocument.Variables.Add Name:="Temp2", Value:="10"
MsgBox ActiveDocument.Variables("Temp2").Value
This example displays the contents of the active data record in the data source attached to Main.doc.

For Each dataF In Documents("Main.doc").MailMerge.DataSource.DataFields
    If dataF.Value <> "" Then dRecord = dRecord & dataF.Value & vbCr
Next dataF
MsgBox dRecord
This example creates an AutoCorrect entry and then displays the value of the new entry.

AutoCorrect.Entries.Add Name:="i.e.", Value:="that is"
MsgBox AutoCorrect.Entries("i.e.").Value
This example checks the grammar in the active document and then displays the Flesch reading-ease index.

ActiveDocument.CheckGrammar
MsgBox ActiveDocument.ReadabilityStatistics("Flesch Reading Ease").Value