Domino/Notes Version: 14.5
Add-on Product (if appropriate, e.g. Verse / Traveler / Nomad / Domino REST API): NA
Its Version: NA
Operating System: NA
Client (Notes, Nomad Web, Nomad Mobile, Android/iOS, browser version): NA
Problem/Query:
I have requirement to enable OOO profile programmatically for users who left the organization, so I wrote a below lotusscript to code to achieve this. But when I ran this code OOO profile document is not getting updated in UI and auto-reply is not being sent.
Anyone has any idea what I’m missing here?
Set oooDoc = mdb.GetProfileDocument(“OutOfOfficeProfile”, “”)
oooDoc.Form = “OutOfOfficeProfile”
'Define OOO Settings and Dates
Dim dtLeave As NotesDateTime
Dim dtReturn As NotesDateTime
Set dtLeave = New NotesDateTime(Now) 'Set start date
Call dtLeave.AdjustMinute(5)
Set dtReturn = New NotesDateTime(Now) 'Set return date
Call dtReturn.AdjustYear(2)
Call oooDoc.ReplaceItemValue(“FirstDayOut”, dtLeave)
Call oooDoc.ReplaceItemValue(“FirstDayBack”, dtReturn)
Call oooDoc.ReplaceItemValue(“ShowHours”, “1”) '1 = Specify Hours
Call oooDoc.ReplaceItemValue(“StartTime”, dtLeave)
Call oooDoc.ReplaceItemValue(“EndTime”, dtReturn)
Call oooDoc.ReplaceItemValue(“GeneralSubject”, “Out of Office”)
Call oooDoc.ReplaceItemValue(“AppendSubject”, “”) '1 = Append return date to subject
Call oooDoc.ReplaceItemValue(“GeneralMessage”, “I am away…”)
Call oooDoc.ReplaceItemValue(“ExcludeInternetEmail”, “”) '1 = Don’t exclude automatically reply to mail from internet addresses
Call oooDoc.ReplaceItemValue(“CurrentStatus”, “1”) '1 = Enable, 0 = Disable
Call oooDoc.ComputeWithForm(False, False)
Call oooDoc.Save(True, False)
'Only now enable OOO service
Call mdb.SetOption(DBOPT_OUTOFOFFICEENABLED, True)