Jump to content

How do I check by AutoIt after updating subject one instance for repeat appointment


Recommended Posts

1. Chair new a repeat appointment with subject "test:"
2. Chair  update subject to be "update" for one instance, and keep other instances' subject to be "test".

Then In Outlook Client, check the one instance whose subject is "update"

My method:

1._OL_ItemFind to find the occurrence with subject "test".

$aResult = _OL_ItemFind($oOL, "*Calendar", $olAppointment, "[subject]='" & $sSubject & "'", "", "", "EntryID")

2. Define GetInstanceOfRecurrence to find the recurrence by date.

$changedItem = GetInstanceOfRecurrence($oOL,$aResult[1][0], Default, $sStart)

Func GetInstanceOfRecurrence($oOL, $vItem, $sStoreID, $sStartDate)

 
If Not IsObj($vItem) Then
If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0)
$vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
If @error Then Return SetError(2, @error, 0)
EndIf
; Recurrence object of the appointment
If $vItem.IsRecurring = False Then Return SetError(3, 0, 0)
Local $oRecurrence = $vItem.GetRecurrencePattern
If @error Then Return SetError(4, @error, 0)
 
$oOccurrenceItem = $oRecurrence.GetOccurrence($sStartDate)
If @error Then Return SetError(5, @error, 0)
 
Return $oOccurrenceItem
 
EndFunc   ;==>GetInstanceOfRecurrence
 
3. _OL_ItemFind to verify the updated one instance
$aResult = _OL_ItemFind($oOL, "*Calendar", $changedItem[1][0], "[subject]='" & $sNewSubject & "' And [body]='" & $sNewBody & "' And [Location]='" & $sNewLocation & "'", "","",4)
 
But it seems failed, is there any other function to be called to check this?
Link to comment
Share on other sites

Welcome to AutoIt and the forum!

Have you tried function _OL_ItemRecurrenceExceptionGet?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...