Adding the date and time as dynamic text using a script

Inserting date and time dynamic text allows you to add the current system date and time to the map sheet, which can be updated whenever the map sheet is opened or when you switch between map sheets. Time uses the current system time; the date updates automatically using the date from the computer. The date and time are updated when the map sheet is printed.

You can also format date and time dynamic text using a VBScript expression, which allows you to use a field value or array of field values for the selected field.

Steps:
  1. Start ArcMap.
  2. On the main menu, click Customize > Toolbars > MPS Atlas.
  3. Click the Add Dynamic Text button Add Dynamic Text on the MPS Atlas toolbar.

    A crosshair with a letter A appears.

  4. Click anywhere in the map sheet layout.

    A piece of dynamic text is inserted on the page.

  5. Double-click the dynamic text.

    The Dynamic Text Properties dialog box appears.

    Date and Time Dynamic Text Properties dialog box
  6. Click the Dynamic Text tab if necessary.
  7. Click the Dynamic Text drop-down arrow and choose Date and Time.
  8. Click Insert.

    The Date and Time text appears in the text box.

  9. Click the dynamic text element in the text field.

    The Date and Time Dynamic Text Properties dialog box appears.

    Date and Time Dynamic Text Properties dialog box
  10. Click the Expression option.
  11. Click Edit Script.

    The Expression Parser dialog box appears.

    Date and Time Dynamic Text Expression Parser dialog box
  12. In the Expression area, click to right of the Generate = expression.
  13. Double click a field name in the Parameter list.

    In the Expression area, the field name appears to the right of Generate =: Generate = [NAME].

    TipTip:

    Double click a field name without an _arr suffix.

  14. Click Verify.

    The Output area lists Function evaluated successfully.

  15. Click OK to close the Expression Parser dialog box.
  16. Click OK to close the Date and Time Dynamic Text Properties dialog box.
  17. Click OK to close the Dynamic Text Properties dialog box.

    The dynamic text displays in the page layout.

  18. NoteNote:

    If you change the layer or data frame, the expression will be cleared. A new layer will require a new set of function parameters.


4/19/2012