GetCurValues

Syntax

GetCurValues DialogRecord

Remarks

Stores in DialogRecord the current values for a previously defined dialog record for a Word dialog box. You use Dim to define a dialog record (for example, Dim dlg As ToolsOptionsSave), GetCurValues to store the settings (for example, GetCurValues dlg), and the syntax DialogRecord.ArgumentName to return specific settings (for example, save = dlg.FastSaves). You do not need to use GetCurValues with a dialog record for a custom dialog box; if you do, the instruction has no effect.

Example

This Word version 6.0 example uses GetCurValues to retrieve the date the active document was created from the Document Statistics dialog box (Summary Info command, File menu). The instructions then use date functions to calculate the number of days since the document was created and display a message box according to the result.


Dim dlg As DocumentStatistics
GetCurValues dlg
docdate$ = dlg.Created
age = Now() - DateValue(docdate$)
age = Int(age)
Select Case age
    Case 0
        MsgBox "This document is less than a day old."
    Case Is > 0
        MsgBox "This document was created" + Str$(age) + " day(s) ago."
    Case Else
        MsgBox "Check your computer's date and time."
End Select

For an example that uses GetCurValues and shows how to toggle any check box, see Abs().

See Also

Dialog, Dim