A programmatic way to get/set Out of Office profile in Lotus Notes

Alex Chan  May 7 2015 10:00:00 PM


Thanks to Kevin, he has created a LotusScript class which allows developers to manipulate OOO profile information in your Notes applications easily. This class allows you to:
  • get or set Out-of-Office profile for yourself or on behalf of someone else
  • query other people Out-of-Office status

The class works in conjunction with OOO Manager. So, you need to have
OOO Manager in place on one of your Domino server.

Use method GetOOOProfile(username) to get the OOO profile of the user.
Use method SaveOOOProfile(profile) to save the OOO profile after changes.


Below is a sample program to get and set OOO profile for any user.
Option Public
Option
Declare
Use
"OOOManager_LS"

Sub
Initialize
' Create an instance of the OOOManager class for server "Server/ACME"

Dim
ooomgr As New OOOManager("Server/ACME")                
Dim
profile As OOOProfile

' Get an instance of the OOOProfile class for user "John Doe/ACME"

Set
profile = ooomgr.GetOOOProfile("John Doe/ACME")        

If
Not (profile Is Nothing) Then                ' OOO Profile found
' Modify the properties of the OOOProfile

Set
profile.LeavingDate = New NotesDateTime("Today") ' Set Leaving Date  
Set
profile.ReturnDate = New NotesDateTime("Tomorrow") ' Set Return Date
profile.SpecifyHours =
False ' Do not display the time component for the leaving date and return date  
profile.AppendReturnDateToSubject =
True ' Append return date to the subject line          
profile.DateFormat = OOO_DATETIME_FULL
' Display date in full date format                
profile.AdditionalBodyText =
"If you need immediate assistance, please contact:" _
&
Chr(13) & "For Sales: sales@extracomm.com" _
&
Chr(13) & "For Support: support@extracomm.com"
profile.ExcludeInternetAddresses =
False
profile.Enable =
True                ' Enable OOO notification
 

If
ooomgr.SaveOOOProfile(profile) Then  ' OOOProfile has been saved successfully
 
' Display the latest properties after saving the OOOProfile
 
Messagebox "Save result: " & ooomgr.ReturnMsg & Chr(13) &  _
 
"Enable: " & profile.Enable & Chr(13) &  _
 
"Leaving date: " & profile.LeavingDate.LocalTime & Chr(13) &  _
 
"Return date: " & profile.ReturnDate.LocalTime & Chr(13) & _
 
"Specify hours: " & profile.SpecifyHours & Chr(13) & _
 
"Subject: " & profile.ComputedSubject & Chr(13) & _
 
"Body: " & profile.ComputedBody & Chr(13) & _
 
"Additional body text: " & profile.AdditionalBodyText & Chr(13) & _
 
"Append return date to subject: " & profile.AppendReturnDateToSubject & Chr(13) & _
 
"Date format: " & profile.DateFormat & Chr(13) & _
 
"OOO type: " & profile.OOOType & Chr(13) & _
 
"Exclude Internet addresses: " & profile.ExcludeInternetAddresses
Else

 
' Display the error code and error message if necessary
 
Messagebox "Save Error " & ooomgr.ReturnCode & ": " & ooomgr.ReturnMsg
End
If

Else

' Display the error code and error message if necessary

Messagebox
"Error " & ooomgr.ReturnCode & ": " & ooomgr.ReturnMsg
End
If
End
Sub



To retrieve other people OOO status, you can use methods:
  • GetOOOStatus(username_or_groupname As String)
  • GetOOOStatusXML(username  As String)

Below is a sample program how you can retrieve other people OOO status.
Option Public
Option
Declare
Use
"OOOManager_LS"
Sub
Initialize
' Create an instance of the OOOManager class for server "Server/ACME"

Dim
ooomgr As New OOOManager("Server/ACME")                
Dim
resultArray As Variant
Dim
paramArray As Variant

' Get the OOO status for user "John Doe/ACME" as a string array

resultArray = ooomgr.GetOOOStatus(
"John Doe/ACME")        

If
resultArray(0) <> "" Then        ' OOO status has been successfully retrieved
Forall
s In resultArray
 paramArray =
Split(s, ooomgr.Delimiter  ' Use the Split function to separate each delimited string
 
' Display the attributes of the OOO entry
 
Messagebox ("IsValid: " & paramArray(0) & Chr(13) &  _
 
"Username: " & paramArray(1) & Chr(13) &  _
 
"ErrorMsg: " & paramArray(2) & Chr(13) &  _
 
"OOOEnable: " & paramArray(3) & Chr(13) &  _
 
"LeavingDate: " & paramArray(4) & Chr(13) &  _
 
"ReturnDate: " & paramArray(5) & Chr(13) &  _
 
"SpecifyHours: " & paramArray(6))
End
Forall
Else

' Display the error code and error message if necessary

Messagebox
"Error " & ooomgr.ReturnCode & ": " & ooomgr.ReturnMsg
End
If
End
Sub



Script Library and sample code database
Image:A programmatic way to get/set Out of Office profile in Lotus Notes
OOOManagerLib.nsf


Class OOOManager


Properties:
Name Remark
String ServerName
String Delimiter Defaults to "%~%".
Integer ReturnCode Read-only.
Defaults to 0.
String ReturnMsg Read-only.
Defaults to "".



Methods:
Name Remark
Sub New (servername As String) Return an OOOManager instance for a specific server.
Function GetOOOProfile(username As String) As OOOProfile Return an OOOProfile instance for a specific user.

If error occurs, this function will return Nothing, while the ReturnCode property and ReturnMsg property will contain the corresponding error code and error message respectively.
Function SaveOOOProfile(profile As OOOProfile) As Boolean Return True if the OOO profile of a specific user has been enabled, disabled or updated successfully. In addition, the following return code and return message will be set to the ReturnCode property and ReturnMsg property respectively:



ReturnCode ReturnMsg
OOO_PROFILE_SAVE_ENABLED_CODE = 1001 OOO_PROFILE_SAVE_ENABLED_MSG = "Out of Office notification has been enabled"
OOO_PROFILE_SAVE_DISABLED_CODE = 1002 OOO_PROFILE_SAVE_DISABLED_MSG = "Out of Office notification has been disabled"
OOO_PROFILE_SAVE_UPDATED_CODE = 1003 OOO_PROFILE_SAVE_UPDATED_MSG = "Out of Office profile has been updated"








If error occurs, this function will return False, while the ReturnCode property and ReturnMsg property will contain the corresponding error code and error message respectively.
Function GetOOOStatus(username_or_groupname As String) As Variant Return the OOO status of a specific user or user group as a string array. Each element in the array is a delimited string, which contains the attribute values of an OOO entry for a user. You can use the LotusScript Split function to separate the delimited string into a string array of attribute values with the following structure:



Element Position Description
0
IsValid:   indicate whether OOO entry for a user has been retrieved successfully or not.

"1" means OOO entry has been retrieved successfully.

"0" means OOO entry cannot be retrieved.
1
Username:   the name of the user.
2
ErrorMsg:  indicate the reason why an OOO entry cannot be retrieved.
3
OOOEnable:   indicate whether OOO notification for a user has been enabled or not.

"1" means OOO notification has been enabled.

"0" means OOO notification has not been enabled.
4
LeavingDate:   the leaving date in case OOO notification has been enabled.
5
ReturnDate:   the return date in case OOO notification has been enabled.
6
SpecifyHours:   indicate whether the leaving date and return date will include the time component.

"1" means the leaving date and return date will include the time component.

"0" means the leaving date and return date will be date only.








If error occurs, this function will return an array with a single empty string element, while the ReturnCode property and ReturnMsg property will contain the corresponding error code and error message respectively.
Function GetOOOStatusXML(username  As String) As String The purpose of this function is similar to the GetOOOStatus function, but it will return an XML string instead of a string array. The resulting XML string looks like this:

Image:A programmatic way to get/set Out of Office profile in Lotus Notes

If error occurs, this function will return an empty string, while the ReturnCode property and ReturnMsg property will contain the corresponding error code and error message respectively.



Class OOOProfile

Properties:
Name Remark
String ServerName Read-only.
String Username Read-only.
Boolean Enable
DateTime LeavingDate
DateTime ReturnDate
Boolean SpecifyHours
String Subject
String ComputedSubject Read-only.
The resulting subject line to be displayed in the profile.
String ComputedBody Read-only.
The resulting body line to be displayed in the profile.
String AdditionalBodyText
Boolean AppendReturnDateToSubject
String DateFormat Possible values:
OOO_DATETIME_DEFAULT = "DEFAULT"

OOO_DATETIME_SHORT = "SHORT"

OOO_DATETIME_MEDIUM = "MEDIUM"

OOO_DATETIME_LONG = "LONG"

OOO_DATETIME_FULL = "FULL"

OOO_DATETIME_PATTERN1 = "PATTERN1"     (i.e. DD/MM/YYYY)

OOO_DATETIME_PATTERN2 = "PATTERN2"     (i.e. MM/DD/YYYY)

OOO_DATETIME_PATTERN3 = "PATTERN3"     (i.e. YYYY/MM/DD)

OOO_DATETIME_PATTERN4 = "PATTERN4"     (i.e. DD MMM, YYYY)

OOO_DATETIME_PATTERN5 = "PATTERN5"     (i.e. MMM DD, YYYY)

OOO_DATETIME_PATTERN6 = "PATTERN6"     (i.e. day, DD MMMM, YYYY)

OOO_DATETIME_PATTERN7 = "PATTERN7"     (i.e. day, MMMM DD, YYYY)
String OOOType Read-only.
OOO_TYPE_AGENT = "AGENT"

OOO_TYPE_SERVICE = "SERVICE"
Boolean ExcludeInternetAddresses



Methods:
Name Remark
Sub New(servername As String, username As String) Return an OOOProfile instance for a specific user.

Raise errors under some conditions.
Sub Reset() Reset the property values of the current OOOProfile instance to the ones previously retrieved or saved.
Function Save() As Integer Possible return values:
OOO_PROFILE_SAVE_ENABLED_CODE = 1001

OOO_PROFILE_SAVE_DISABLED_CODE = 1002

OOO_PROFILE_SAVE_UPDATED_CODE = 1003


Raise errors under some conditions.





    How to query other people out-of-office status in IBM/Lotus Notes

    Alex Chan  June 10 2014 11:45:27 PM

    Is John out of the office?


    "Is John in the office today? His Out-of-Office notification said that he will return today," Mary asked.

    "I am not sure but I heard that he has extended the vacation," Peter replied.

    "Did he change his return date?  You know, I won't receive another Out-of-Office notification even he changed his schedule. How can I check his latest Out-of-Office status?" Mary asked.

    "You can use Query Out-of-Office Status side-bar widget in your Notes client and you will get the answer instantly," Peter replied.
     

    Currently, some ways to find out an individuals out of office status is to:

    • Ask others within the organization or visit the individual’s specific department or location to find out
    • Send an email to the user and wait to receive the Out of Office notification
    With the above options, chances are that you may not get a quick answer right away without having to spend time and effort searching.

    Thankfully, Out of Office Manager’s ability to query other user Out of Office status will save you effort and time in which you will have the answer instantly. Out of Office Manager allows querying other out of office status via the iPhone or Android OOO App, or the Notes sidebar widget.  As the below screenshots illustrate, simply type a username or group name and you will get the out of office status of user(s) instantly.

     

    ** Notes Sidebar Widget **
    ** iPhone App **

    Image:How to query other people out-of-office status in IBM/Lotus Notes

    Image:How to query other people out-of-office status in IBM/Lotus Notes



    The great thing about this feature is that the out of office status will be the latest status, even if the user changed or updated the out of office schedule just minutes prior.  

    {More details}

     

      Enable an out-of-office message when an employee calls in sick

      Alex Chan  January 9 2014 03:20:46 AM
      In Notes 8 or above, you can enable out-of-office message on behalf of someone else.

      But there is one requirement, you must be the delegate with Editor-level or above rights to the user's mail file.

      This means the delegate has full access to the user's mails. This is undesirable.

      We want someone who can help to enable or disable or update the out-of-office settings. But we don't want this person having the rights to peek at the users' mails.

      Out-of-Office Manager from Extracomm is the solution that allow central management of out-of-office settings by help-desk or Domino administrators.


      Extracomm's Out-of-Office Manager
      http://www.extracomm.com/Out-Of-Office-Manager

      IBM Notes Out of Office (OOO) Management: Today and Beyond
      http://www.extracomm.com/home.nsf/www/Managing_OOO_Today_Beyond

        How to analyze questionable deletions in a Notes database

        Alex Chan  November 29 2013 02:47:20 AM
        I came across a technote (FAQ) from IBM today. The title is "How to analyze questionable deletions in a Notes database".

        You can find the full technote here.

        Question:
        "Is there a way to analyze if the documents were in fact deleted and is it possible to find out what the source of the deletion was?"

        Answer:
        "Notes does not explicitly log deletions for a database so there is no way to definitively check the source of a deleted document."

        Right. It is very difficult and almost impossible to find out the answer for the question by built-in Domino logging features.

        However, this difficult question comes up very often. You might ask this question or being asked this question before.

        To answer this question, you need a tool which can provide info of

        1) Who deleted it?
        2) When did it happen?
        3) What was deleted?
        4) Source of the deletion?

        With Extracomm's SecurTrac, all info is captured by SecurTrac.

        Image:How to analyze questionable deletions in a Notes database



        Initiator: The person who deleted the document.  If the document was deleted by replication, the Initiator is the source server which pushed the deletion and the Is From Replication flag will be Yes.

        Time: The date and time of the deletion happened.

        Database path and Document ID: It shows you which database and which document was deleted.

        Service: "nserver" means it was deleted from a Notes client. "namgr" means it was deleted by an Notes Agent. "nhttp" means it was deleted by a browser.

        Restore the document: You can restore the deleted document by clicking the "Restore the document" button.

        For more details, visit SecurTrac product page





          You can now set Out-of-Office noticiatons in IBM Notes in different date formats to avoid confusion

          Alex Chan  September 25 2013 05:20:15 AM
          With the release of Out-of-Office Manager 2.1.9, Out-of-Office notifications can now be sent in various different date formats.

          Examples:
          9/10/13
          Sep 10, 2013
          September 10, 2013
          Tuesday, September 10, 2013

          Have you ever encountered problem in interpreting DD/MM/YYYY or MM/DD/YYYY when the mails are sent across countries?  When the date is sent in format "Sep 10, 2013", this will surely avoid the confusion.


          Image:You can now set Out-of-Office noticiatons in IBM Notes in different date formats to avoid confusion

          Date format available:
          • Default
          • Short Date Format
          • Medium Date Format
          • Long Date Format
          • Full Date Format
          • DD/MM/YYYY
          • MM/DD/YYYY
          • YYYY/MM/DD
          • DD MMM, YYYY
          • MMM DD, YYYY
          • day, DD MMMM, YYYY
          • day, MMMM DD, YYYY


          For more details,

          http://www.extracomm.com/Out-Of-Office-Manager

            How to scan and fax documents using your smart phone

            Riza Celep  August 26 2013 04:00:29 PM

            Have you ever thought that your smart phone can be used as your fax machine? Have you ever had the need to fax a document but didn't have a fax machine nearby?

            With the staggering rate of smart phone adoption worldwide and the increasing quality of the phone camera, scanning a document and faxing it via your mobile device can be as easy as sending an email.

            Requirements:

            1.        iPhone with a document scan app.

            2.        ExtraFax server in your environment.

            Setup:

            Install a document scanner program. In the example below, we have used "Genius Scan - PDF Scanner" iPhone application. This application can be downloaded from below link.

            https://itunes.apple.com/us/app/genius-scan-pdf-scanner/id377672876?mt=8

            Scan to Fax:

            1.  Start the scanner program.

            2.  Capture the document.

            Image:How to scan and fax documents using your smart phone

            3. Click "Use". The document will be trimmed and turned into black and white (see below).

            Image:How to scan and fax documents using your smart phone

            4. Next, click the "forward" button on the bottom right hand corner.

            Image:How to scan and fax documents using your smart phone

            5. Click "Email" as your method of delivery.

            Image:How to scan and fax documents using your smart phone

            6. Select Actual size for best quality.

            Image:How to scan and fax documents using your smart phone

            7. Email it to ExtraFax to complete the faxing job.

            The email to fax addressing format is:
            fax_no@fax_domain

            In our example, "12345678" is the fax number and "extrafax.extracomm.com" is the Internet email domain configured.

            8. Done. Your document will be faxed via ExtraFax and you will receive a confirmation report via email.

              Introducing ExtraFax for Exchange

              Riza Celep  July 24 2013 02:09:11 PM


              Image:Introducing ExtraFax for Exchange

              The wait is almost over. ExtraFax for Microsoft Exchange will be released on August 6, 2013.


              As part of our ongoing efforts to provide "The Ultimate Fax Server" in the world, we are super excited to announce that ExtraFax will soon be available for Microsoft Exchange! Our valued customers will soon be able to experience the full benefits of ExtraFax on both IBM Domino and Microsoft Exchange.

              FREE TRIAL AVAILABILITY


              Whether you’re an existing or a potential customer, we are looking forward to providing you options to suit your company’s faxing needs. We will be more than happy to provide you free evaluation version of ExtraFax so you can experience the full benefits and features within your own environment.

              Stay tuned for the latest information on our Microsoft Exchange version release!

                Growing need for transparency. Do you have the necessary tools?

                Riza Celep  July 24 2013 01:21:37 PM

                Image:Growing need for transparency. Do you have the necessary tools?

                In today’s economic climate, companies are constantly faced with strained budgets and are focused on keeping costs low in order to remain competitive. With this being said, companies are still spending hefty amount on compliance and auditing tools – all thanks to growing corporate need and government regulatory transparency. To meet such requirements, companies are always on the lookout for robust and reliable tools that will facilitate information logging and reporting, solutions that are proven and easy to use with enterprise wide implementation. Having such tools assists companies in meeting compliance and auditing requirements, whether internal or for external policies.

                Since its release, Extracomm’s SecurTrac solution has assisted many companies in enabling compliance requirements (internal and external). SecurTrac, a comprehensive tool that monitors and audits your knowledge assets, is a non-disruptive and non intrusive compliance solution for corporate governance and auditing. It is the only complete audit trail system that tracks the life cycle of all objects, as well as all operational activities within the IBM Notes Domino environment.

                Click here to Download a free 30 day evaluation of SecurTrac.
                Click here for the SecurTrac product page.

                Why wait until its too late?

                Riza Celep  August 31 2012 02:53:00 PM

                Image:Why wait until its too late?

                In a world full of regulations, threats and constant exchange of information, organization’s need go well beyond securing their environment and take proper action before it is too late.

                In any corporate environment, unexpected activities travel through a Domino environment everyday and typically go undetected until it is too late to take corrective action. At that point, when auditors and/or management come knocking on the door looking for specific information, you have not logged anything, resulting in major losses for the organization.

                One significant problem is that some organizations tend to wait and put other priorities ahead, causing to delay their compliance and auditing requirements until it’s too late. From our past experience, we normally recommend to log and monitor your Domino environment early as possible before an issue arises and emergency situation does occur. Essentially, organizations have to perpetually monitor and log all the activities in their Domino environment in order to know who did exactly what, when, where and how.  In today’s business world, the stakes are high and accountability is everything.


                What is an audit trail and why is it needed?


                Image:Why wait until its too late?

                In simplest terms, an audit trail will seize the bad guys, detect inconsistencies, demonstrate compliance and assure that your organization is protected against internal and external threats. More importantly, it assures that all the activities that travel through your Domino Environment is used only in intended and appropriate ways. This logged information can be the difference maker for an organizations success and protects them against significant losses that often go undetected until it’s too late.

                So why wait?

                SecurTrac is a non-disruptive and non-intrusive compliance solution for corporate governance and auditing. It is the only complete audit trail system that tracks the life cycle of all user activities and other objects within IBM Lotus Notes and Domino.

                Product Resource links:

                - SecurTrac brochure
                - Success Stories
                - SecurTrac product page
                - SecurTrac recorded web demo

                  ExtraFax Virtualization

                  Riza Celep  July 31 2012 03:01:10 PM
                   
                  Image:ExtraFax Virtualization

                  With the ongoing trend in many organizations to consolidate and reduce the number of physical servers in their environment to help save capital and operating costs, many companies continue to virtualize their servers. Running servers in a virtual environment such as VMware or Microsoft Hyper-V has quickly become the new standard in I.T. datacenters.
                   
                  At Extracomm, many customers have asked us “I want to virtualize my ExtraFax server. How can I do this?” Generally speaking, there has always been one major hurdle to overcome as it relates to being able to virtualize any fax server, including ExtraFax. The main issue relates to the fact that fax boards are not natively compatible when installed directly within virtual server hardware. This dilemma has prevented many organizations from being able to virtualize their ExtraFax server.
                   
                  Click here to review this document which will highlight some of the different methods that organizations can consider which would allow them to virtualize their ExtraFax server implementation, including 100% Virtualization of an ExtraFax server using T.38 FoIP(Fax over IP).
                   
                  Click here for ExtraFax product page.