Jump to content
VishnuNair

Outlook Calendar Items

Recommended Posts

VishnuNair

Hello,

I am new to AutoIt and am working on script which can check the outlook calendar for a given time slot and give an output if that slot is free or not. If not list the appointments.

can this be done using the OutlookEX UDF? Please note i am using Outlook 2013

Please let me know.

Thanks,

Vishnu

 

Edited by VishnuNair

Share this post


Link to post
Share on other sites
water

Please have a look at function _OL_RecipientFreeBusyGet from the OutlookEX UDF.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
VishnuNair

Thanks Water. I will take a look at the OL_RecipientFreeBusyGet Function. Is this function intended only for the recipient or also for the sender? Meanwhile I have written a script using the OL_AppointmentGet function. I am not sure what is wrong here. The $appt never gives any value. Can you please help?

 

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            $StartDate = GUICtrlRead($Inputdt1)
            $StartTime = GUICtrlRead($Inputtm1)
            $EndDate = GUICtrlRead($Inputdt2)
            $EndTime = GUICtrlRead($Inputtm2)


            $Appt = _OL_AppointmentGet($OOutlook, $Path, $StartDate, $StartTime)
            If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderAccess Example Script", "Error accessing the default contacts folder. @error = " & @error)

            MsgBox(0x40000000, 0,'get appointment ' &$Appt)
        _OL_Close($oOutlook)
    EndSwitch
WEnd

Edited by VishnuNair

Share this post


Link to post
Share on other sites
water

The function returns a one based two-dimensional array. That's why MsgBox doesn't work. Use _ArrayDisplay instead.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

_OL_RecipientFreeBusyGet function. Is this function intended only for the recipient or also for the sender?

Call the function for all people who should attend the meeting. Then check the results for a free time.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
VishnuNair

Thank you Water. I used the _OL_RecipientFreeBusyGet function in the following code and attached is the result.

 

 

While 1
    Global $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            Global $StartDate = GUICtrlRead($Inputdt1)
            Global $StartTime = GUICtrlRead($Inputtm1)
            Global $EndDate = GUICtrlRead($Inputdt2)
            Global $EndTime = GUICtrlRead($Inputtm2)


          Global $Appt = _OL_RecipientFreeBusyGet($OOutlook, $Path, $StartDate, $iMinPerChar, $bCompleteFormat)

            MsgBox(0x40000000, 0,'get appointment ' &$Appt)
        _OL_Close($oOutlook)
    EndSwitch
WEnd

 

I am unable to interpret the results as it only gives 0's or 1's. I found that 0 character stands for Free and 1 for Tentative.My question is from what period to what period is this calculation done?

Can you please help me here?

Thanks,

Vishnu

 

Capture.PNG

Edited by VishnuNair
edit

Share this post


Link to post
Share on other sites
water

According to the docu in the UDF:
"The default is to return a string representing one month of free/busy information."


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
VishnuNair

Wow!! One month that is a lot.

Is there anyway i can use the same script to return the value for a specific time frame for example 26th August 2015 @ 8:00 am?

Is this possible? Or use some other function?

Share this post


Link to post
Share on other sites
water

You can only specify the start date/time plus the granularity (means the number of minutes each returned character stands for).
For examples please check _OL_RecipientFreeBusyGet.au3


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
VishnuNair

Thank you very much Water. I used the function and it worked fine :)

Thank you very much..Have a great day!!

Share this post


Link to post
Share on other sites
water

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends,
      I am having a requirement where i have to automate outllook.I have to send mail using outlook.Whe i went through the forum i got OutLookEx.au3 but when i am trying to use this i am getting error can anyone help me in using this? @water
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I'm working on a project where incoming emails are to be analyzed based on the subject line and moved to various folders in a shared mailbox.
      I'm using "OutlookEx.au3" of @water. The macro can can move emails  to any folder that I newly create. But the macro couldn't move emails to specific folders that are already existing.
      I checked the permission levels of those folders and found that nothing is wrong with that. The function I use is _OL_ItemMove.
      Please guide me how to proceed further. Thanks in advance.
      -Gowrisankar.
       
    • nooneclose
      By nooneclose
      Good morning everyone, I thought I had already solved this issue but it turns out I did not. 
      My code finds unread emails with this specific subject line of "request" but when I change the subject to SKIPPED + "request" = ("SKIPPED request") the program still finds the email and tries to process it. I only want to process emails with the exact match subject of "request".
      Here is my code that "finds" the unread emails with the subject of "request" or so I thought. 
      Func ListUnreadEmails() ;******************************************************************************* ; Lists all unread E-mails from the folder Outlook-UDF-Test ;******************************************************************************* ; Stores all the unRead emails into an array Global $aItems = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test", $olMail, _ "[UnRead]=True", "Subject", "request", "EntryID,Subject", "", 1) ; Displays the array of unRead emails If IsArray($aItems) Then ;_ArrayDisplay($aItems, "OutlookEX UDF: _OL_ItemFind - Unread mails") Else MsgBox(48, "OutlookEX UDF: _OL_ItemFind Example Script", _ "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf ; Gets the number of unread emails Global $numberOfUnRead = UBound($aItems, $UBOUND_ROWS) - 1 ;MsgBox("", "Number of Unread emails", $numberOfUnRead) EndFunc It acts as if any part of the subject containing the word "request" and the email is unread that it will try to process it. (I think)
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • nooneclose
      By nooneclose
      Hello again everyone, I am trying to make a simple bot/AI to help me at work. I need it to read the subject line of emails, open them if a certain subject line is found, and then copy the contents of the said email and paste it in a different program. 
      Can the Autoit outlook UDF help me achieve this? 
      Also, I have tried the Outlook UDF and so far I have only figured out how to find all the unread emails (thanks to one of water's example scripts. @water you are a genius just saying).
      I am very new to this UDF and would love any help that would guide me into making this bot/AI a reality at work.   
×