Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

Add

#include <debug.au3>
_DebugSetut()
_DebugCOMError()

at the tiop of your script to get more detailed error information.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Add

#include <debug.au3>
_DebugSetup()
_DebugCOMError()

at the tiop of your script to get more detailed error information.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Add

#include <debug.au3>
_DebugSetup()
_DebugCOMError()

at the tiop of your script to get more detailed error information.

​@@ DEBUG COM Error encountered is script.exe (-1):

Number = 0x80020006 (-2147352570)

WinDescription = Unknown name

Description =

Source =

HelpFile =

HelpContext =

Last Dll Error = 0

Retcode = 0x00000000

​@@ DEBUG COM Error encountered is script.exe (-1):

Number = 0x80040154 (-2147221164)

WinDescription = Class is not registered

Description =

Source =

HelpFile =

HelpContext =

Last Dll Error = 0

Retcode = 0x00000000

Link to comment
Share on other sites

This means that Outlook is not installed on this machine.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

This means that Outlook is not installed on this machine.

​Hmm, it certainly is. Tested on two other comps, same thing.

Other one has Outlook 2013 and other one has 2010. Only works on my dev machine (2010).

Maybe Outlook needs to be re-installed?

Link to comment
Share on other sites

Do you have the full version of Outlook installed on this machines? Not the trial version? Or upgraded from the trial version to the full version?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Thanks again for an awesome UDF, just experiencing one issue while using it.

 

Our company uses SSO to authenticate users, and has each user's SSO listed in the alias field in Outlook. For most of our users, the SSO resolves, your UDF works flawlessly, and the email is sent. However for all of our users who are setup with a single-letter last name (for users in India this is quite common), it fails every single time with the below error. The same does not occur for those who have single-letter first names however.

x35KPox.png

 

Here's some very rudimentary code (with the actual alias removed) which produces the above error:

#include <includes\OutlookEx\OutlookEx.au3>
#include <debug.au3>
_DebugSetup()
_DebugCOMError()
Global $oOL = _OL_Open(), $oSSO = "000000000"
Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.")
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $oSSO)
_OL_ItemSend($oOL, $oItem)
_OL_Close($oOL)

 

I've troubleshot this with a coworker, and it seems to be isolated to the _OL_ItemSend() function (as preparing the message in the Drafts or Outgoing folders does in fact work). What makes it strange is just that - preparing the message translates the name just fine. If I remove the call to _OL_ItemSend() then the message is in the Drafts folder, with the person's name in the "To" field.

 

Any assistance you could provide would be appreciated.

Edited by cembry90

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

When you manually create an email and enter the one letter recipient, is Outlook able to resolve it?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

When you manually create an email and enter the one letter recipient, is Outlook able to resolve it?

​Yep, sure does! And as I mentioned above - if I remove the call to actually send the email, the email ends up in the Drafts folder with the person's name on the email.

F0NnSd0.png

 

I tracked it down to the following:

Func _OL_ItemSend($oOL, $vItem, $sStoreID = Default)

    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(1, @error, 0)
    EndIf
    $vItem.Send()
    If @error Then MsgBox(0, '', 'ERROR')
    If @error Then Return SetError(2, @error, 0)
    Return $vItem

EndFunc   ;==>_OL_ItemSend

It's specifically failing on $vItem.Send()

 

Confirmed this using the following code:

#include <includes\OutlookEx\OutlookEx.au3>
#include <debug.au3>
_DebugSetup()
_DebugCOMError()

; Open the connection to Outlook
Global $oOL = _OL_Open()

; Create a mail item and set some properties
Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.")

; Add a recipient and resolve it
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, "000000000")

; Send the mail
;_OL_ItemSend($oOL, $oItem)
$oItem.Send()

; Close the object
_OL_Close($oOL)

 

Thank you.

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

What is the value of @error and @extended after _OL_ItemRecipientAdd?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

#include <includes\OutlookEx\OutlookEx.au3>
#include <debug.au3>
_DebugSetup()
_DebugCOMError()

; Open the connection to Outlook
Global $oOL = _OL_Open()

; Create a mail item and set some properties
Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.")

; Add a recipient and resolve it
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, "000000000")
ConsoleWrite(StringReplace(StringFormat("@error: %s\n@extended: %s\n", @error, @extended), "\n", @CRLF))

; Send the mail
;_OL_ItemSend($oOL, $oItem)
$oItem.Send()

; Close the object
_OL_Close($oOL)

@error: 0
@extended: 0

Edited by cembry90

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

Which version of the UDF do you run? Version info can be found in the header lines of the UDF.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Could you please give an example of what $oSSO (in your example set to "000000000") looks like?
Is it "Lastname, Firstname" or something else?
"K, something" as I take from your screenshot is the resolved displayname of the user?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Could you please give an example of what $oSSO (in your example set to "000000000") looks like?
Is it "Lastname, Firstname" or something else?
"K, something" as I take from your screenshot is the resolved displayname of the user?

​It's literally the alias in Outlook. Example:

7rH6zu5.png

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

But could you please give an example for the CONTENT of such an Alias field for which the send then fails?
So I could then create such an alias here and do more testing.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

But could you please give an example for the CONTENT of such an Alias field for which the send then fails?
So I could then create such an alias here and do more testing.

Sorry about that. Ours are nine-digit numbers, which is why I replaced it with nine 0s.

$oSSO = "000000000"

$oSSO = "123456789"

$oSSO = "112233445"

 

Any of those.

Edited by cembry90

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

I see.

I will create two contacts:
One with a nine digit number as alias and a Last name with only one character.
Another with a nine digit number as alias and a Last name with more than one character.

The first should fail on send.

BTW: Did you tell me which version of Outlook you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

Another idea:
I assume your contacts are stored in the Global Address Book.
Could you create a contact in your personal contacts with an Alias an a one-letter Lastname and check if the problem still exists with this contact?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

I see.

I will create two contacts:
One with a nine digit number as alias and a Last name with only one character.
Another with a nine digit number as alias and a Last name with more than one character.

The first should fail on send.

BTW: Did you tell me which version of Outlook you run?

​Microsoft Office Professional Plus 2010 - Version: 14.0.7145.5000 (32-bit)

 

Another idea:
I assume your contacts are stored in the Global Address Book.
Could you create a contact in your personal contacts with an Alias an a one-letter Lastname and check if the problem still exists with this contact?

Tried to find a way to do this, but it appears it's controlled by an Exchange server and thus you can't give address book contacts an alias.

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...