Range.InsertDateTime Method 

Inserts the current date or time, or both, either as text or as a TIME field.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim DateTimeFormat As Object
Dim InsertAsField As Object
Dim InsertAsFullWidth As Object
Dim DateLanguage As Object
Dim CalendarType As Object
Dim range1 As Range
range1.InsertDateTime(DateTimeFormat, InsertAsField, InsertAsFullWidth, DateLanguage, CalendarType)

Syntax

Sub InsertDateTime( _
    <InAttribute()> Optional ByRef DateTimeFormat As Object, _
    <InAttribute()> Optional ByRef InsertAsField As Object, _
    <InAttribute()> Optional ByRef InsertAsFullWidth As Object, _
    <InAttribute()> Optional ByRef DateLanguage As Object, _
    <InAttribute()> Optional ByRef CalendarType As Object _
)
void InsertDateTime(
    [In, Optional] ref object DateTimeFormat, 
    [In, Optional] ref object InsertAsField, 
    [In, Optional] ref object InsertAsFullWidth, 
    [In, Optional] ref object DateLanguage, 
    [In, Optional] ref object CalendarType
);
public: Void InsertDateTime(
    &Object^ DateTimeFormat, 
    &Object^ InsertAsField, 
    &Object^ InsertAsFullWidth, 
    &Object^ DateLanguage, 
    &Object^ CalendarType
);
public void InsertDateTime(
    /*in*/System.Object DateTimeFormat, 
    /*in*/System.Object InsertAsField, 
    /*in*/System.Object InsertAsFullWidth, 
    /*in*/System.Object DateLanguage, 
    /*in*/System.Object CalendarType
);
function InsertDateTime(
     DateTimeFormat : Object, 
     InsertAsField : Object, 
     InsertAsFullWidth : Object, 
     DateLanguage : Object, 
     CalendarType : Object
);

Parameters

  • DateTimeFormat
    Optional Object. The format to be used for displaying the date or time, or both. If this argument is omitted, Microsoft Word uses the short-date style from the Windows Control Panel (Regional Settings icon).
  • InsertAsField
    Optional Object. True to insert the specified information as a TIME field. The default value is True.
  • InsertAsFullWidth
    Optional Object. True to insert the specified information as double-byte digits. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
  • DateLanguage
    Optional Object. Sets the language in which to display the date or time. Can be either of the WdDateLanguage constants: wdDateLanguageBidi or wdDateLanguageLatin. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
  • CalendarType
    Optional Object. Sets the calendar type to use when displaying the date or time. Can be either of the WdCalendarTypeBi constants: wdCalendarTypeBidi or wdCalendarTypeGregorian. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Range Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Range Members