Jump to content

OutlookEX UDF


water
 Share

Recommended Posts

ok, i had a quick look at the old UDF, and it looks in a folder within outlook called Tasks, which has been associated with the variable value of 13 (not sure if this is anything to do with outlook or not)

Now as the old UDF was written in outlook 2003 and the flagging of emails was introduced in 2007 it was not added to the UDF,

All that would be required is looking into the "To-Do" folder within outlook instead of the "tasks" folder.

This i am not sure how to do at the moment, and any help would be appreciated!

i will look into this further next week,

Thank you for providing me with the information to figure this out!

Liam

Link to comment
Share on other sites

I will post an example how to query the ToDo folder as soon as I find some spare 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

This example returns all the tasks from the default ToDo folder. As _OL_ItemFind forces you to specify an objectclass you can't search for all possible item types (Mail, tasks ..) in the ToDo folder with a single call.

Will post another example quite soon:

#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
$aFolder = _OL_FolderAccess($oOutlook, "", $olFolderToDo)

Global $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olTask, "", "", "", "Subject,Body")
If IsArray($aItems) Then
    _ArrayDisplay($aItems, "Tasks")
Else
    MsgBox(48, "OutlookEX UDF", "Could not find a single item. @error = " & @error & ", @extended: " & @extended)
EndIf
_OL_Close($oOutlook)

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

This script returns all items with flag "IsmarkedAsTask" set to True:

#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
$aFolder = _OL_FolderAccess($oOutlook, "", $olFolderToDo)

Global $sFilter = "@SQL=" & Chr(34) & "http://schemas.microsoft.com/mapi/proptag/0x0E2B0003" & Chr(34) & " = 1"
Global $aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $sFilter, "EntryId,Subject,Categories")
If @error Then
    MsgBox(16, "OutlookEX UDF - _OL_ItemSearch Example Script", "Error running _OL_ItemSearch. @error = " & @error & ", @extended = " & @extended)
Else
    _Arraydisplay($aResult, "MarkedAsTask")
EndIf
_OL_Close($oOutlook)

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

#include <C:\Users\liam.welsh\Desktop\AutoIT\Outlook Prop\OutlookEX.au3>
#include <array.au3>

Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
$aFolder = _OL_FolderAccess($oOutlook, "", $olFolderToDo)

Global $sFilter = "@SQL=" & Chr(34) & "http://schemas.microsoft.com/mapi/proptag/0x0E2B0003" & Chr(34) & " = 1"
Global $aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $sFilter, "EntryId,Subject,Categories")
Global $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olTask, "", "", "", "Subject,Body")
dim $aResults[1]
$aresults[0] = $aItems[0][0] + $AResult[0][0]
$i = 0
If IsArray($aItems) And IsArray($aResult) Then
    Do
       $i = $i+1
       _arrayadd($aResults,$aItems[$i][0])
    until $i = $aItems[0][0]
    $i=0
    Do
       $i = $i+1
       _arrayadd($aResults,$aResult[$i][1])
    until $i = $aResult[0][0]
    _Arraydisplay($aResults, "MarkedAsTask")
 Else
    MsgBox(16, "Alfred", "Error running Task Search")
EndIf
_OL_Close($oOutlook) 

Amazing! You are a genius!

I have manipulated the code a little in order to combine to the 2 (as one returned created tasks and the other returns flagged emails)

I have attached it for no real reason other than someone reading it and offering me advice (or getting something from it)

One more question, which is probably an obvious one one, how would i filter it so that only tasks that have not been completed come through?

Thank you water! you have been an amazing help,

Keep up the good work mate, i love all your UDF's and a lot of your posts across the forum have benefited me!

Liam

Link to comment
Share on other sites

Glad you like my UDFs :)

You can retrieve the value of the "Completed" property and only process those records in the table with "False".

Global $aResult = _OL_ItemSearch($oOutlook, $aFolder[1], $sFilter, "EntryId,Subject,Categories,Completed")

Or, but a bit more complex would be to extend the search string in $sFilter . But this would enhance performance.

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

All properties, collections, objects, methods and events for Outlook 2010 can be found here.

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

Glad you like the UDF :)

There is no function available to assign delegates right now. I searched the web and the MSDN site but couldn't find a way to do it via COM.

But it seems to be possible using PowerShell cmdlets with Exchange 2010. Check this site to get an idea.

It seems that COM has its limitations :(

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

:)

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

  • 3 weeks later...

Thanks water for another fantastic UDF. I've got a question about _OL_MaiLSignatureCreate. I've created a script using the example script as a base, and everything imports successfully into Outlook. The signature contains an image (JPG), and the image scales up by about 137% (original image 400x62, embedded image 536x85). When I save the image from the email it is still the original size, so it isn't actually changed during the process.

I'm guessing the scaling is happening some time during the creation of the signature body in the hidden Word object, but I don't know enough about the Word.Application object to check or change the scaling. Any ideas?

Link to comment
Share on other sites

After doing some more Googling it turns out the problem is caused by Outlook. Apparently when an image has a DPI setting of less than 96, the image is scaled up a bit. I'm adding some stuff to the image with GDI+ already, so I'll be poking around a bit there to see if I can change the DPI just before saving it into the signature...

Link to comment
Share on other sites

Thanks for this information. Learned something new today :)

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

Thanks for this information. Learned something new today :)

 

Yeah it's a weird one, apparently inherited - in typical Microsoft fashion - from years' old code (1993!). Here's where I got my info: http://www.howto-outlook.com/faq/unsharpimages.htm

The "conversion" takes place during Outlook's setting of the signature via the _OL_MaiLSignatureCreate function. The smoking gun is the .htm file it creates in the AppDataRoamingMicrosoftSignatures folder: the <img> tag for the embedded image contains absolute values for the width and height. These values are calculated from the DPI of the image, versus the DPI of your system, and then saved in the .htm file, where Outlook dutifully obeys them and scales up the image, blurring it slightly. 

Converting the file to 96 DPI before manually embedding it into the signature in Outlook's GUI shows this theory to be true - the width and height are still added as absolute values in the .htm file, but they are now the original image's dimensions. The signature image now displays correctly as well.

BTW I have almost given up on resetting the PNG file's DPI via AutoIT, the GDIPlus.au3 and GDIP.au3 files are a bit too messy for me...

Sorry for babbling on about Outlook signatures :)

Link to comment
Share on other sites

  • 3 weeks later...

Yes, you could post the script you are using :)

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

BTW: Please only post in the "OutlookEX UDF - Help & Support (III)" thread.

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

  • 5 months later...

Hey Water, 

I have a funky request for an odd problem.

I was brought in to support a system, at the software level they are using Outlook 2007 but at the server they have Exchange 2013.

For what ever strange reason when you open outlook for the first time when it should auto connect and create your profile it errors out saying "cannot connect to exchange" or similar.

Users can not get into their email unless

A.) I setup the mail profile manually with user/server credentials

B.) After Outlook has been opened once and attempted to auto populate the user information, close it and go to the control panel and delete the mail profile created.  After you delete the profile open Outlook again and like magic every time the auto connect works and you can next through the entire profile setup.

I am browsing through the UDF, I do not see it but was looking for a way to write a script to create the mail profile for them at login so dance around this issue.

However being that you know so much, you may know how to fix the issue all together rather than apply an autoit bandaid. 

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

  • Recently Browsing   0 members

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