Jump to content
water

OutlookEX UDF - Help & Support (IV)

Recommended Posts

Posted (edited)

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?

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Great :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.


 

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I have a few add-ins installed (screenshot).  But I don't believe I use many (or any?) of them.  As a test, can/should I temporarily disable them?

Share this post


Link to post
Share on other sites

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@water Sorry, I spoke too soon.  I'm still experiencing the issue.  Stand by while I do more tests though...

Share this post


Link to post
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?

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Posted (edited)

>> 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

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Posted (edited)

>> 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

Share this post


Link to post
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 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Taks Scheduler (NEW 2019-09-14 - Version 0.5.0.0) - Download - General Help & Support - Wiki

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

  • Similar Content

    • By Skysnake
      This assumes implementation of the OutlookEX UDF.
      I have PSTs which are becoming unmanageable 
      The idea is to make a simple GUI (Listview) which can combine non-Outlook data and include emails based on criteria.  Manage them in the GUI (delete / reply etc) and update to Outlook.
      So the issue would be to manage the items in the GUI while using the PST as a database.
      Ideas on how to do this? What would the key be?
    • By Reizvoller
      Howdy!
      I've been reading through the OutLookEX documentation and examples for the past two days ( VERY well documented, very clear! ) 
      https://www.autoitscript.com/wiki/OutlookEX_UDF_-_General
       
      But I've had trouble locating information on specifying what user to use. My outlook is linked to two email accounts and I can only manipulate the main account's stuff. A simple script I've been playing with is this 
      ; Include Functions #include <OutlookEX.au3> ; Connect to Outlook Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Connect to Outlook", "Error connecting to Outlook. @error = " & @error & ", @extended = " & @extended) ;List the folders Global $aResult = _OL_FolderTree($oOutlook, "*") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_FolderTree Example Script", "Error accessing root folder. @error = " & @error) _ArrayDisplay($aResult, "OutlookEX UDF: _OL_FolderTree Example Script - All folders") It works like a charm but it only returns my main account's folders. 
      I really hope I didn't overlook a wiki page or help file... 
      Any assistance would be greatly appreciated!
      -Reiz
    • By galan2015
      Is there any solution on receiving e-mails? I would like to create a script so that I will not have to log in through the browser.
×
×
  • Create New...