Find time of Out of Office

Hi There,

I have an agent in a database which runs to see if an assignee is out of office. the agent uses ‘agent.IsEnabled’ code to find if its enabled or not.

The problem i am having is that someone may enable their out of office agent, but for a time in the future. Is there a way where i can get the time for set in their out of office agent?

Here is my code so far :

Sub CheckOfficeStatus(PDoc)

Dim s As New NotesSession

Dim Mdb As New NotesDatabase("","")

Dim strUCode As String

Dim strMailPath As String

Dim OAgent As NotesAgent



strUCode = PDoc.Usercode(0)

strMailPath = PDoc.MailPath(0)



If strMailPath = "" Then

	Exit Sub

End If



Set Mdb = s.GetDatabase(dbMailServer,strMailPath)

Set OAgent = Mdb.GetAgent("OutOfOffice")



If OAgent.IsEnabled = True Then

	Pdoc.OfficeStatus = "Yes"

Elseif OAgent.IsEnabled = False Then

	Pdoc.OfficeStatus = "No"

End If

End Sub

Thanks for any help, it would be fantastic if i could get this working!

F1H

Subject: Find time of Out of Office

Hi,

Did you check the “OutOfOfficeProfile” document by using the notesDatabase.GetProfileDocument?

I know there are some fields that could help you:

DateFirstDayOut

DateFirstDayBack

Hope this helps

Have a nice day,

Jean-Louis

Subject: RE: Find time of Out of Office

Thanks very much Jean-Louis - you’ve been a great help!!

that is working perfectly!!

F1H