How to enable out of office programatically?

Hi guys,

I have an agent that gets some values from a document in a database, then based on the username from the document, gets their mail server and mail file name from the NAB, opens their mailbox, opens their out of office profile, and sets some fields (start and end date) based on values obtained earlier.

All this works fine, except it doesnt enable the out of office. The start and end date, subject etc all get changed and saved, but the profile doesn’t want to enable.

If there anyway to do this, without opening the out of office profile and click “Enable and Close”

Thanks

part of code…

Set userOOODoc.FirstDayOut = startDate

Set userOOODoc.FirstDayBack = endDate

userOOODoc.GeneralMessage = bodyText

userOOODoc.CurrentStatus = “1”

userOOODoc.CurrentStatusDisplay=“On”

userOOODoc.BookBusyTime=“1”

computeForm = userOOODoc.ComputeWithForm(True, True)

Call userOOODoc.Save(True, False)

Subject: You have to enable OOO agent (hint: IsEnabled property of NotesAgent).

Subject: 8.5 Forum

Hi Konrad,

Thanks for this, I have it working now (Agent is enabled as you suggest), however no out of office alerts are being sent…

I wrongly posted this in the 8 forum though, so have moved it to the 8.5 forum. Please see the link below to the post with more information etc.

This post is now redundant and super-seeded by the post in the 8.5 forum.

Thanks

http://www-10.lotus.com/ldd/nd85forum.nsf/7756aedc25e6d81285256324005ac76c/f3593e4f1530de2185257a9b00328fea?OpenDocument