Examples: DateFmt property (NotesViewColumn - LotusScript®)

This agent toggles the date format for a column.

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim vc As NotesViewColumn
  Dim f As String
  Set db = session.CurrentDatabase
  Set view = db.GetView("View A")
  Set vc = view.Columns(2)
  If vc.DateFmt = VC_FMT_MD Then
    vc.DateFmt = VC_FMT_Y4M
    f = "Year4 + month"
  Elseif vc.DateFmt = VC_FMT_Y4M Then
    vc.DateFmt = VC_FMT_YM
    f = "Year + month"
  Elseif vc.DateFmt = VC_FMT_YM Then
    vc.DateFmt = VC_FMT_YMD
    f = "Year + month + day"
  Else
    vc.DateFmt = VC_FMT_MD
    f = "Month + day"
  End If
  Messagebox f,, "New date format"
End Sub