Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

"Outlook Data Files (.ost) are used when you have an Exchange account and want to work offline or use the default Cached Exchange Mode. This type of data file is also used for accounts that you set up with the Outlook Connector for Outlook.com (formerly Hotmail). Outlook Data Files (.ost) are always copies of items that are saved on a mail server and don’t need to be backed up like Outlook Data Files (.pst)."

So _OL_Open connects to a local data file (OST, PST) or a remote server (Exchange ...) depending on the type of store.

As soon as you connect your computer to a network Outlook tries to synchronize offline stores with the remote server.

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

@water 

>> So _OL_Open connects to a local data file (OST, PST) or a remote server (Exchange ...) depending on the type of store.

OK.  I have several stores in my Outlook.  How do I determine the "type" of each store?  And how do I know which types connect to the local data file, and which types make a remote connection?

 

Link to comment
Share on other sites

OK, why don't you try to show some effort yourself?
This kind of information can easily be found using Google or by having a look at the functions of the OutlookEX UDF. Hint: _OL_StoreGet ;)

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

@water OK I can do that.  I found this documentation page about store objects.  It unfortunately appears to have some outdated information about IMAP accounts and OST files.   It indicates that PST files are used for IMAP email accounts in Outlook.  The documentation page you linked earlier also contains the same information.  But that contradicts what it says on this other MS documentation page about PST and OST files.  This page indicates that OST files--not PST files--are used for IMAP email accounts, which is also the behavior with my Outlook--all of my IMAP files use OST files.

So in light of that, with these IMAP stores, should I expect _OL_Open to connect to the local OST data file or the remote server?  This is the crux of my issue, and what I'm still very unclear on.  Earlier you mentioned,

>> _OL_Open just uses the AutoIt functions ObjGet and ObJCreate to connect to Outlook or create a new instance. 

Perhaps I should post in the general AutoIt forums asking exactly how ObjGet and/or ObjCreate connect to these stores?

>> This kind of information can easily be found using Google or by having a look at the functions of the OutlookEX UDF. Hint: _OL_StoreGet

I am admittedly a novice when it comes to AutoIt, so reading through an advanced function written by someone else would be difficult.  That's why I'm asking my question in this forum.

 

Link to comment
Share on other sites

If IMAP accounts are represented by a PST or OST file depends on the installed version of Outlook. _OL_Open will always connect to the local representation of such accounts.
The connection to the remote server is being done by Outlook when a network connection is available. Then Outlook synchronizes the servers content with the local OST file.

The Outlook UDF comes with a OutlookEx.htm help file. Open this help file, search for "Store" and you will find _OL_StoreGet. The description will tell you which information to expect:

Quote

Success - two-dimensional one based array with the following information:
    0 - display name of the Store object
    1 - Constant in the OlExchangeStoreType enumeration that indicates the type of an Exchange store
    2 - Full file path for a Personal Folders File (.pst) or an Offline Folder File (.ost) store
    3 - True if the store is a cached Exchange store
    4 - True if the store is a store for an Outlook data file (Personal Folders File (.pst) or Offline Folder File (.ost))
    5 - True if Instant Search is enabled and operational
    6 - True if the Store is open
    7 - String identifying the Store (StoreID)
    8 - True if the OOF (Out Of Office) is set for this store
    9 - Warning Threshold represented in kilobytes (in KB)
    10 - The limit at which a user can no longer send messages represented in kilobytes (KB)
    11 - The limit where receiving mail is prohibited (also the maximum size of the mailbox) in kilobytes (KB)
    12 - Contains the sum of the sizes of all properties in the mailbox or mailbox root in kilobytes (KB)
    13 - The free space in the mailbox represented in kilobytes (KB)
    14 - The maximum size for a message that a user can send represented in kilobytes (KB)

 

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

OK that is helpful, thanks.  And I can have a further look through the documentation files for each UDF function.

But finally, maybe I should address the overarching issue.  Namely, you said earlier ,

>> You should expect _OL_Open to connect to ALL defined stores of a profile may they be located on an Exchange server, in a local PST-file or on a Google mail server.

In my case, I want to simply use the Outlook UDF to create a new task, which will be stored in one single PST file on my computer.  This particular PST file is linked to no email accounts--it contains only my tasks, reminders, and calendar.  So you are saying that in order to create this task with the Outlook UDF, it needs to make a connection to every single email account in my Outlook profile?  If so, that seems completely unnecessary from my admittedly novice point of view.  I guess that's the way it has to be.  But wouldn't you agree that at best it's a tad inefficient, and at worst, it completely prohibits the use of the Outlook UDF?  In my case, the latter is what seems to be occurring.  If my Outlook profile has 10 stores, and I want to use the UDF to edit one of those stores, why does the UDF need to connect to the remaining 9 stores?  

Is it possible to instruct _OL_Open to bypass certain stores when making its connections?  That sounds like a more efficient course of action, and one that would alleviate the issue I'm experiencing.  Or, if Outlook is already open and has connected to all its stores, perhaps _OL_Open can simply use those existing connections, rather than having to make new connection?  But now I'm admittedly just thinking off the top of my head.  Or maybe as a workaround I could create a second Outlook profile--a profile containing only the PST with my tasks/calendars.  Then _OL_Open wouldn't have to connect to all my other stores.  But then I would have two profiles, and I would need to have Outlook open on my computer with both profiles at the same time--is that even possible?

Edited by cag8f
Link to comment
Share on other sites

The issue you describe is not related to the Outlook UDF but to Outlook itself.Outlook opens all stores defined in a profile.
The way to solve this problem is to create a new profile with only a single store and then use this profile with _OL_Open (check the help file how to do).
The profile needs to be created manually as MS does not provide an interface to do this programmatically.

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

How to create a new profile is described here (though I have never done it myself): https://support.combell.com/en/how-do-i-create-a-new-mail-profile-in-outlook/200

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

@water 

>> The issue you describe is not related to the Outlook UDF but to Outlook itself.Outlook opens all stores defined in a profile.

Right O.

>> The way to solve this problem is to create a new profile with only a single store and then use this profile with _OL_Open (check the help file how to do).
>> How to create a new profile is described here (though I have never done it myself): https://support.combell.com/en/how-do-i-create-a-new-mail-profile-in-outlook/200

Right.  I'm aware using a profile with only one store can alleviate my issue, and I know how to create a new profile.  But doing so may cause a new, prohibitive issue.  Namely, once I create that new profile I will now have two different profiles:

  • Profile 1:  A single PST containing only my tasks/reminders/calendar items.
  • Profile 2:  10 different email accounts--a mixture of POP (PST) and IMAP (OST).

Whenever I open Outlook, I will need Outlook to load both of these profiles. Is it possible to load two different profiles in Outlook?  Or open two different instances of Outlook, each with a different profile?  Intuition, experience, and a quick search indicate that the answer is 'no' (post 1, post 2).  So creating a new profile isn't a viable solution in my case.

Just to be 100% sure before I pursue an alternative:  `_OL_Open` will connect to every Outlook store even if Outlook is already open, and has already connected to those stores.  Is that accurate?

Edited by cag8f
Link to comment
Share on other sites

I suggest to have two profiles:

  • The default profile you use right now should hold ALL stores including the PST for your tasks/reminders/calendar items
  • The second profile should only hold the PST for your tasks/reminders/calendar items

So when performance is an issue open Outlook with profile two, else use the default profile.

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

@water Thanks for that suggestion.  It could be viable in other situations, but I don't think it will be in my case.  In my case, I am looking to create a keyboard shortcut which will simply create a new Outlook task and add some text in the description.  I sometimes do this many times a day, which is why i'd like a keyboard shortcut to do it quickly.  If I have to:

  • close Outlook
  • re-open Outlook with profile 2
  • execute the keyboard shortcut
  • close Outlook
  • re-open Outlook with profile 1

then you can see that it defeats the purpose of the keyboard shortcut.

It looks like I'll have to use a different approach.  Although I initially tried doing this with simple `Send()` commands, but encountered a different error--see post here, It was in that post that I was referred to the Outlook UDF.  

I appreciate your help and patience.  In the least, I learned some things about the Outlook UDF.  I may use it to automate the PST backups that I manually carry out every month.

Link to comment
Share on other sites

Another idea would be to have a (slightly) modified version of _OL_Open.
Now _OL_Open tries to connect to an already running instance of Outlook. If there is none, a new instances is started.
The modification would drop the check for a running instance and always start a new one (which could be started with profile #2).
Don't know if Outlook supports this but it would be worth a try.

There is only one drawback. If the running Outlook instances opens your task PST you can't open it in a second instance.

 

Edit: Just noticed that this is post #24000 on this forum :cheer:

Edited by water

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

Or you could split your task into two pieces.

  1. The script just waits for the hotkey and writes the task to a file in a specific folder with a unique name (timestamp)
  2. Another script periodically checks the folder for new tasks and creates them in your PST file. As this task is not time critical it does not matter now long it takes. Whne the task has been created the file is deleted.
    This script runs in a loop so _OL_Open is only called once at startup time.

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

@water Well to be clear,  Earlier I said I am looking to create a keyboard shortcut which will create a new Outlook task and add some text in the description.  That is not untrue.  But after the AutoIt script carries that out, I will need the task to remain open and active so i can then add more text to it (and make some modifications to reminder date, category, etc).  Does this new information change your split-task-into-two-pieces method?  I didn't quite understand it, but I noticed you mentioned that *somethign* was not time critical.

Another idea would be to have a (slightly) modified version of _OL_Open.
Now _OL_Open tries to connect to an already running instance of Outlook. If there is none, a new instances is started.
The modification would drop the check for a running instance and always start a new one (which could be started with profile #2).
Don't know if Outlook supports this but it would be worth a try.

So are you saying I would be the one to modify `_OL_Open`?

> Edit: Just noticed that this is post #24000 on this forum

Congrats!

Link to comment
Share on other sites

If you want to edit the task immediately after it has been created then my "solution" won't help.

The _OL_Open approach doesn't help either as Outlook won't create a second instance.

So, right now, I'm out of ideas :(

 

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

On 3/21/2019 at 4:59 PM, water said:

@Juvigy Never had to cope with Group Policies.
How does it affect you? Is this limited to VBA macros in Outlook or do you encounter problems with Autoit scripts accessing Outlook as well?

It stops my outlook macros that call autoit scripts.

Link to comment
Share on other sites

In this case you need to ask your admin :(

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'm not sure if I'm at the correct place here but I should give it a try.

I think there's an error when using default values for fetching calendar entries. This works:

$oi = _OL_ItemFind($oo, $of[1], $olAppointment, "[Start]>'01/04/2019 00:00'", "", "", "", "",4)

$oi = _OL_ItemFind($oo, $of[1], $olAppointment, "[Start]>'01/04/2019 00:00'", "", "", "", "",4)

I'm getting a value with the correct count.

This throws an error:

$oi = _OL_ItemFind($oo, $of[1], $olAppointment, "[Start]>'01/04/2019 00:00'")

"C:\...\autoit\Include\OutlookEX.au3" (2947) : ==> The requested action with this object has failed.:
$aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex]).value
$aItems[$iCounter][$iIndex - 1] = $oItem.ItemProperties.Item($aReturnProperties[$iIndex])^ ERROR

But if I specify the ReturnProperties, it works again:

$oi = _OL_ItemFind($oo, $of[1], $olAppointment, "[Start]>'01/04/2019 00:00'","","","EntryID,Subject")

 

Link to comment
Share on other sites

Which version of Outlook do you run?
Which version of AutoIt do you rin?
Which version of the OutlookEX UDF do you use?

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

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