This code will enforce a unique Date/Time Setting and Time Zone Setting on a user's PC. It will also send alert messages to the Admin Group and user when the date format setting needs to be updated.
Go to Database Script area in Database Resources in the Database. In Database Script "Initialize Event", place the code shown below. Be sure to modify the group names and member names according to your NAB.
Code
Sub Initialize
Dim session As New NotesSession
Dim international As NotesInternational
Dim memo As NotesDocument
Set international = session.International
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Dim sendMess As String, intServerDay As Integer,
intServerMonth As Integer, intServerYear As Integer,
strServerNow As String
sendMess = "AdminGroupName "
strServerNow = ServerNow()
intServerDay = Day(ServerNow())
intServerMonth = Month(ServerNow())
intServerYear = Year(ServerNow())
If Not international.IsDateDMY Or
Len(Trim(Mid(Date(),7,4)))<4
Then
Msgbox "Please change your date
format setting to dd/MM/yyyy in --->
Control Panel - Regional Settings and
restart Lotus Notes" ,64,"Date Setting Alert"
Set memo =
session.CurrentDatabase.CreateDocument()
memo.Form = "Memo"
memo.SendTo = sendMess
memo.Subject = "Regional date
settings of " & session.
CommonUserName & " 's PC is
not set properly"
memo.Body = "This is a auto
message generated on "
& ServerNow() & " from "
& session.CommonUserName
'Call memo.Send(False)
Call uidoc.Close
Exit Sub
End If
If international.TimeZone <> -4 Then
Msgbox "Please change your
Time Zone setting to (GMT + 04:00)
Abu Dhabi, Muscat ---> Control Panel
- Date Time - Time Zone and
restart Lotus Notes" ,64,"Time Zone Alert"
Set memo =
session.CurrentDatabase.CreateDocument()
memo.Form = "Memo"
memo.SendTo = sendMess
memo.Subject = "Time Zone settings of " &
session.CommonUserName & " 's
PC is not set properly"
memo.Body = "This is a auto message
generated on "
& ServerNow() & " from "
& session.CommonUserName
'Call memo.Send(False)
Call uidoc.Close
Exit Sub
End If
End Sub
This tip was submitted to the SearchDomino.com tip exchange by member Vishal Sancheti. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.