Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

There is confusion here. 

MS Outlook must be installed and activated. 

In the script the "outlook item" is an object. To use it you must create your own object, manipulate that object by giving it a recipient, subject and body and any other attributes you require, then send the object. 

See the wrapper functions? Everything is set out nicely. 

Once you get the wrapper functions working, play with the rest. 

Remember that it's an object... 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

@Skysnake and @water thanks for the replies.  I actually determined the cause of my issue--user error 🙂 I actually had another AutoIt program already running, which is why I was encountering issues with _OL_Open() not functioning as expected.  I closed that other program, and my issues were resolved.  I will continue to test _OL_ItemCreate().

Thanks!

Link to comment
Share on other sites

Great :)

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

OK I'm back.  I am continuing with _OL_ItemCreate().  The second input parameter I have to specify is,

>> $iItemType - Type of item to create. Is defined by the Outlook OlItemType enumeration

How do i determine the Outlook OlItemType enumeration?  Can I use Au3Info.exe to do that?  Or do I have to determine it using another method?

To be clear, I am trying to create a new Outlook task (screenshots).

Thanks.

Link to comment
Share on other sites

This constants are defined in OutlookEXConstants.au3.

In your script set the cursor in line

#include <Outlook.au3>

and press Alt+i. OutlookEx.au3 will be opened.
Then set the curosr in line

#include <OutlookExConstants.au3>

and press Alt+i again.
Now search for "OlItemType" and you will get a list of all available item types.

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

@water OK thanks for that.  But sorry, I'm afraid I need to back-up.  My .au3 file contains the simple code:

#include <OutlookEX.au3>

    Local $test = _OL_Open();
    ConsoleWrite("OUTLOOK CONNECTION OPENED");
    _OL_Close($test);

 

When I run this program, it takes about 30 seconds for the message "OUTLOOK CONNECTION OPENED" to appear in the console.  Is that expected?  If not, am I missing something, or misunderstanding something?  I should be clear that before I run this code, I have already opened Outlook manually.

Thanks.


 

Link to comment
Share on other sites

Here it takes about 25 ms to run the following script:

#include <OutlookEX.au3>

Local $hTimer = TimerInit()
Local $oOL = _OL_Open()
ConsoleWrite("OUTLOOK CONNECTION OPENED. Duration: " & TimerDiff($hTimer) & @CRLF)
_OL_Close($oOL)

Which version of Outlook do 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

I just tried your code, and am experiencing the same issue--about a 30 second duration.  I'm running Outlook 2013.

edit:  Sorry, I may have spoke to soon.  Stand by...

Edited by cag8f
Link to comment
Share on other sites

Do you use any Outlook addons? In rare cases they can cause problems.

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

Good idea. Hope this sheds some light onto the subject. 

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

@water OK wow, that did it.  I can't say which specific add-in was the issue, but I disabled all, and the run time is now ~100 ms.  I don't think I need any of those add-ins, so I will just leave them all disabled for now.  Thanks for that.  I will carry on with my testing.

Link to comment
Share on other sites

:)

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

@water OK here is what I see.  I first disabled all Outlook add-ins (screenshot).  I then continued to test using an AU3 file containing the exact same code you gave me.  If I boot up Windows, open Outlook manually, then run the AU3 file, the code completes very quickly (~100 ms) as expected).  But if I immediately run the same AU3 program (without closing SciTE), it requires ~30 seconds to complete.  All subsequent executions of the program also require 30 seconds to complete.  Thoughts on that?  Is there any other troubleshooting I can try?

Link to comment
Share on other sites

Never seen this behavior before :(
Does the start of Outlook re-enable the Addins?

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

>> Does the start of Outlook re-enable the Addins?

No, I double checked that.   The add-ins remain disabled.  

Do you have any ideas how I can troubleshoot this?  I'm open to any kind of testing/troubleshooting tests.

One thing I can do is try to run this on a different computer.  So far I have run all tests on my desktop computer, running Windows 10 x64.  I also have a laptop running Windows 10 x86.  I can try testing there and let you know. 

But I'm open to any and all other testing.  Maybe except for re-installing Outlook--I don't think i want to undertake that.  But what about switching to a new Outlook 'profile,' then opening Outlook with that new profile?  Might that be a decent test?

Edited by cag8f
Link to comment
Share on other sites

Do you run the 32 or 64 bit version of Outlook?

Outlook and the AutoIt script need to have the same "bitness".

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

>> Do you run the 32 or 64 bit version of Outlook?

These desktop tests have been running the 64 bit version of Outlook.  My laptop--which runs Win 10 x86--runs the 32 bit version of Outlook.  How can I confirm which version of AutoIt script I am running (i.e. 64 bit vs. 32 bit)?

Edited by cag8f
Link to comment
Share on other sites

Add the following lines at the top of your script to compile both versions:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

You get a scriptname.exe and a scriptname_x64.exe .
You can then decide which of the compiled Exe you need to run.
Macro @AutoItX64 returns 1 if the script runs as x64.

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

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

×
×
  • Create New...