Sign in to follow this  
Followers 0
zhxiaoyu

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

2 posts in this topic

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?

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

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
Sign in to follow this  
Followers 0