I just noticed that Outlook does not allow to import iCal events programmatically.
I might implement some of the iCalendar data format (RFC 5545) if someone is interested
Please post here or click the "Like" button if you think this is a good idea
Edit: For download please see my signature
I had a problem using OutlookEX when automating Outlook v14 (2010) when it was already running; the object returned from _OL_Open wasn't usable .
As a test, this example would fail to create an object for $objMail but there was no error from _OL_Open()
$outlook = _OL_Open() $objMail = $outlook.Application.CreateItem(0) but this replacement would work:
$outlook = ObjCreate("Outlook.Application") $objMail = $outlook.Application.CreateItem(0) and this would fail:
$outlook = ObjGet("", "Outlook.Application") $objMail = $outlook.Application.CreateItem(0) So for my own purposes, the "fix" was to just to add a flag for _OL_Open() to ObjCreate() instead of ObjGet() when needed, setting it to True when there's a problem
Func _OL_Open($bCreateNew = False, $bWarningClick = False, $sWarningProgram = "", $iWinCheckTime = 1000, $iCtrlCheckTime = 1000, $sProfileName = "", $sPassword = "") If $bCreateNew = Default Then $bCreateNew = False If $bWarningClick = Default Then $bWarningClick = False If $sWarningProgram = Default Then $sWarningProgram = "" If $iWinCheckTime = Default Then $iWinCheckTime = 1000 If $iCtrlCheckTime = Default Then $iCtrlCheckTime = 1000 If $sProfileName = Default Then $sProfileName = "" If $sPassword = Default Then $sPassword = "" Local $oOL = ObjGet("", "Outlook.Application") If IsObj($oOL) Then $__bOL_AlreadyRunning = True If Not IsBool($bWarningClick) Then Return SetError(3, 0, 0) If Not IsInt($iWinCheckTime) Then Return SetError(4, 0, 0) If Not IsInt($iCtrlCheckTime) Then Return SetError(7, 0, 0) If $__bOL_AlreadyRunning And $sProfileName <> "" Then Return SetError(10, 0, 0) ;Specified a profile name to logon to but Outlook is already running. ; Activate the COM error handler for older AutoIt versions If $__iOL_Debug = 0 And (Number(StringReplace(@AutoItVersion, ".", "")) < 3392 Or Number(StringReplace(@AutoItVersion, ".", "")) > 33120) Then _OL_ErrorNotify(4) SetError(0) ; Reset @error which is returned by _OL_ErrorNotify if a COM error handler has already been set up by the user EndIf If Not $__bOL_AlreadyRunning Or $bCreateNew Then $oOL = ObjCreate("Outlook.Application") If @error Or Not IsObj($oOL) Then Return SetError(1, @error, 0) EndIf
However, the problem with modifying a UDF is in remembering to apply the same fix for to any update
Was there any other "fix" I should have tried before tampering with the UDF?
Extensive library to control and manipulate Microsoft Outlook.
Theads: Development - General Help & Support - Example Scripts - Wiki
There is another UDF (OutlookTools) available (as a beta at the moment) to import/export contacts and events to VCF/ICS files.
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
KNOWN BUGS (last changed: 2019-06-05)