Jump to content

OutlookEX UDF - Help & Support


Recommended Posts

-2147352567 is hex 80020009 and can be everything (DISP_E_EXCEPTION - unknown programming error).

Can you please insert

$iOL_Debug = 2
after the #include statement and post the MsgBox you get?

And can you please post the complete script you try to run?

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

-2147352567 is hex 80020009 and can be everything (DISP_E_EXCEPTION - unknown programming error).

Can you please insert

$iOL_Debug = 2
after the #include statement and post the MsgBox you get?

And can you please post the complete script you try to run?

I actually got this to work, and it seemed to work great. I ran the same thing a few times, and the calendar should block multiple reservations occuring at the same time, but it goes from accepted to tentative, and overlaps the reservations. But it goes in, and sends an email and everything like it should.
Link to comment
Share on other sites

Glad you got it running!

... the calendar should block multiple reservations occuring at the same time ..

I don't think Outlook works this way. You can have multiple appointments at the same time without any (error) message from Outlook.

You have to check in advance if there are any reservations for the needed time period.

$sFreebusy = _OL_RecipientFreeBusyGet($oOL, "Mobile Broadband - USB Verizon Hotspot ©", "2011/05/20 16:00", 60)
$sFreebusy = StringLeft($sFreebusy, 4)
If StringInStr($sFreebusy, "1") > 0 Then MsgBox(16, "FreeBusy Check", "There is already a reservation!")
This will get a string where each character ("0" or "1") represents 60 minutes starting with 2011/05/20 16:00. If there is the character "1" in the first 4 characters (time between 16:00 and 20:00) then the resource has already been reserved in this time period.

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

Hi I am having trouble figuring out how to search the global address list for a contact and then collect the contact's details. I have found the examples using the contacts folder, however I am not able to modify it to work with the global address list. If anyone could point me in the right direction or provide an example that would be great! I am using outlook 2007 on windows 7. Thanks!

Link to comment
Share on other sites

Do you just want to search the Global Address List (GAL) and ignore all other address lists? Or are you just interessted to resolve a contact and then get the details?

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

Do you just want to search the Global Address List (GAL) and ignore all other address lists? Or are you just interessted to resolve a contact and then get the details?

Hi Water, I just want to search the GAL. I don't need to search any of the other lists. So for example if I have the name "John Smith", I want to be able to search the GAL for "John Smith" and then collect all of the details associated with John (email_address, Company, office etc..

To do this I am assuming I would use _OL_ItemFind and then _OL_ItemGet, however I have no idea how to point the find function at the GAL.

Thanks

Link to comment
Share on other sites

Here is an example that works for Exchange users:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <outlookex.au3>

$iOL_Debug = 2
Global $sRecipient = "Please enter here the recipient to resolve"

Global $oOL = _OL_Open()
Global $oOL_Recipient = $oOL.Session.CreateRecipient($sRecipient)
If @error <> 0 Or Not IsObj($oOL_Recipient) Then Exit MsgBox(16,"Outlook Test", "Error creating the recipient object. @error: " & @error & ", @extended: " & @extended)
$oOL_Recipient.Resolve
If @error <> 0 Or Not $oOL_Recipient.Resolved Then Exit MsgBox(16,"Outlook Test", "Error resolving recipient: " & $sRecipient & ". @error: " & @error & ", @extended: " & @extended)
; Exchange user that belongs to the same or a different Exchange forest
If $oOL_Recipient.AddressEntry.AddressEntryUserType = $olExchangeUserAddressEntry Or _
    $oOL_Recipient.AddressEntryAddressEntryUserType = $olExchangeRemoteUserAddressEntry Then
    Global $oOL_Item = $oOL_Recipient.AddressEntry.GetExchangeUser
    ConsoleWrite($oOL_Item.LastName & @CRLF)
    ; more properties for Outlook 2007 can be found here: http://msdn.microsoft.com/en-us/library/bb176658(v=office.12).aspx
EndIf
_OL_CLose($oOL)

First it resolves the entered displayname. The GAL is the first address list to check. If you need to sort out "false positives" (users that aren't in the GAL but in another addresslist) then additional code is needed.

This example displays the lastName if it is an Exchange address entry. Active Directory entries have to be handled different.

To get more properties please use the link I provided in the example.

If you have further questions I will be glad to assist.

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

Here is an example that works for Exchange users:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <outlookex.au3>

$iOL_Debug = 2
Global $sRecipient = "Please enter here the recipient to resolve"

Global $oOL = _OL_Open()
Global $oOL_Recipient = $oOL.Session.CreateRecipient($sRecipient)
If @error <> 0 Or Not IsObj($oOL_Recipient) Then Exit MsgBox(16,"Outlook Test", "Error creating the recipient object. @error: " & @error & ", @extended: " & @extended)
$oOL_Recipient.Resolve
If @error <> 0 Or Not $oOL_Recipient.Resolved Then Exit MsgBox(16,"Outlook Test", "Error resolving recipient: " & $sRecipient & ". @error: " & @error & ", @extended: " & @extended)
; Exchange user that belongs to the same or a different Exchange forest
If $oOL_Recipient.AddressEntry.AddressEntryUserType = $olExchangeUserAddressEntry Or _
    $oOL_Recipient.AddressEntryAddressEntryUserType = $olExchangeRemoteUserAddressEntry Then
    Global $oOL_Item = $oOL_Recipient.AddressEntry.GetExchangeUser
    ConsoleWrite($oOL_Item.LastName & @CRLF)
    ; more properties for Outlook 2007 can be found here: http://msdn.microsoft.com/en-us/library/bb176658(v=office.12).aspx
EndIf
_OL_CLose($oOL)

First it resolves the entered displayname. The GAL is the first address list to check. If you need to sort out "false positives" (users that aren't in the GAL but in another addresslist) then additional code is needed.

This example displays the lastName if it is an Exchange address entry. Active Directory entries have to be handled different.

To get more properties please use the link I provided in the example.

If you have further questions I will be glad to assist.

This is exactly what I needed. Your example works perfectly. Thanks Water!

Link to comment
Share on other sites

:huh2:

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

Hi Syed,

I suspect that you're using all kind of Outlook versions. Here is the latest version of _OL_Open. It works with older Outlook versions (< Outlook 2007) as well.

Func _OL_Open($fOL_WarningClick = False, $sOL_WarningProgram = "", $iOL_WinCheckTime = 1000, $iOL_CtrlCheckTime = 1000)

    If Not IsBool($fOL_WarningClick) Then Return SetError(3, 0, 0)
    If Not IsInt($iOL_WinCheckTime) Then Return SetError(4, 0, 0)
    If Not IsInt($iOL_CtrlCheckTime) Then Return SetError(7, 0, 0)
    If $fOL_WarningClick Then
        If $sOL_WarningProgram = "" Then $sOL_WarningProgram = @ScriptDir & "\_OL_Warnings.exe"
        If Not FileExists($sOL_WarningProgram) Then Return SetError(1, 0, 0)
        Run($sOL_WarningProgram & " " & @AutoItPID & " " & $iOL_WinCheckTime & " " & $iOL_CtrlCheckTime, "", @SW_HIDE)
        If @error <> 0 Then Return SetError(6, @error, 0)
    EndIf
    If ProcessExists("Outlook.exe") > 0 Then $fOL_AlreadyRunning = True
    Local $oOL = ObjCreate("Outlook.Application")
    If @error <> 0 Or Not IsObj($oOL) Then Return SetError(1, @error, 0)
    ; A COM error handler will be initialised only if one does not exist
    If ObjEvent("AutoIt.Error") = "" Then
        $oOL_Error = ObjEvent("AutoIt.Error", "_OL_Error") ; Creates a custom error handler
        If @error <> 0 Then Return SetError(2, @error, 0)
    EndIf
    Local $aVersion = StringSplit($oOL.Version, '.')
    ; Logon to the default profile if Outlook wasn't already running (for Outlook 2007 and later)
    If $fOL_AlreadyRunning = False and Int($aVersion[1]) >= 12 Then
        Local $oOL_Namespace = $oOL.GetNamespace("MAPI")
        $oOL_Namespace.Logon($oOL.DefaultProfileName, "", False, False)
        If @error <> 0 Then Return SetError(8, @error, 0)
    EndIf
    Return $oOL

EndFunc   ;==>_OL_Open

Hi Water,

Sorry for such a long delay in replay. I was in vaccation for my sister marraiage! Regarding this problem! still i am ending up with same error message " Error in expression"

Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Hi Syed,

... "Error in expression"?

I checked the previous posts and didn't find this error before. Could you please post the complete error message you get (line number, statement ..)?

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

Hi Syed,

... "Error in expression"?

I checked the previous posts and didn't find this error before. Could you please post the complete error message you get (line number, statement ..)?

i have attached the error screen shot below! Also i have pasted my code from Line 1207 to 1233! please let me know if you need anything more

Func XPICW()

$ValueDataExp="Global Desktop ICW-Windows XP"

$ValueDataAct=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Kimberly-Clark","Platform")

If $ValueDataAct<>$ValueDataExp Then

MsgBox(64, "Platform Error", "This version of script is written for Windows ICW . Please run the appropriate script for the current Platform")

Call ("Clear")

Else

MsgBox(64,"Information...","The tool creation is in progress... This will be ready by "&@CRLF&@CRLF&_DateAdd('d',7,_NowCalc()))

Call ("Clear")

EndIf

EndFunc

Func VISTAICW()

$ValueDataExp="Global Desktop ICW - Windows VISTA"

$ValueDataAct=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Kimberly-Clark","Platform")

If $ValueDataAct<>$ValueDataExp Then

MsgBox(64, "Platform Error", "This version of script is written for Windows VISTA - ICW . Please run the appropriate script for the current Operating System Platform")

Call ("Clear")

Else

MsgBox(64,"Information....","The tool creation is in progress... This will be ready by "&@CRLF&@CRLF&_DateAdd('d',7,_NowCalc()))

Call ("Clear")

EndIf

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Hi Syed,

I suspect that you have #include statements at the top of your script. So the error might be in one of the includes.

Do you obfuscate your scripts to remove the unused functions/variables?

Is it possible to reproduce the error when running the script from SciTe?

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

Hi Syed,

I suspect that you have #include statements at the top of your script. So the error might be in one of the includes.

Do you obfuscate your scripts to remove the unused functions/variables?

Is it possible to reproduce the error when running the script from SciTe?

you are rite Water! i have all my header files on top of my program! also i have used obfuscate and it created on file with TBL extension. also i don't know how to view that file

I couldn't execute my code in SciTe! if i run in SciTe the code did not runs.. no error or warning messages too.. :huh2:

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Water,

I gave try by removing #RequireAdmin from the code and i gave try to run the script in Scite and it works fine! i wonder how it differes ? :huh2:

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Water,

I gave try by removing #RequireAdmin from the code and i gave try to run the script in Scite and it works fine! i wonder how it differes ? :huh2:

The script is run as administrator. And yes, I think it makes a difference. According to the help file: "Specifies that the current script requires full administrator rights to run." and "As this function launch a new process, some functions as Consolewrite() cannot be captured (Scite will not display anything)."

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

The script is run as administrator. And yes, I think it makes a difference. According to the help file: "Specifies that the current script requires full administrator rights to run." and "As this function launch a new process, some functions as Consolewrite() cannot be captured (Scite will not display anything)."

Oh...Okay! :huh2: ... now how to find that why the mail is not getting send if i execute as EXE and but it woks if i run in Scite! ;) any clue ?

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

No, because under the cover SciTe compiles the script and then runs the exe.

Could you please set $iOL_Debug = 2 after the #include statements and post the result?

Could you use MsgBox to display the returnvalue plus @error after _OL_Open and _OL_ItemSend/_OL_Wrapper_SendMail?

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

No, because under the cover SciTe compiles the script and then runs the exe.

Could you please set $iOL_Debug = 2 after the #include statements and post the result?

Could you use MsgBox to display the returnvalue plus @error after _OL_Open and _OL_ItemSend/_OL_Wrapper_SendMail?

_ol_Open() function returns the error value of "1". also when i opened the obfuscated and i found the line which throws error message. for your reference i have pasted the code below and marked the specific line.

Func _OL_Open($fOL_WarningClick = False, $sOL_WarningProgram = "", $iOL_WinCheckTime = 1000, $iOL_CtrlCheckTime = 1000)

If Not IsBool($fOL_WarningClick) Then Return SetError(3, 0, 0)

If Not IsInt($iOL_WinCheckTime) Then Return SetError(4, 0, 0)

If Not IsInt($iOL_CtrlCheckTime) Then Return SetError(7, 0, 0)

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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