Jump to content
water

OutlookEX UDF - Help & Support (IV)

Recommended Posts

I need to retrieve all the columns available for each item.

_ArrayDisplay() is nice to display data on the screen, but how can I access each record from the To-Do List folder before writing them into a text file?

Share this post


Link to post
Share on other sites
#include <OutlookEX.au3>
Global $aItemProperties
Global $oOutlook = _OL_Open()
$aFolder = _OL_FolderAccess($oOutlook, "", $olFolderToDo)
Global $aResult = _OL_ItemFind($oOutlook, $aFolder[1], $olTask, "", "", "", "EntryID")
For $i = 1 To $aResult[0][0]
    $aItemProperties = _OL_ItemGet($oOutlook, $aResult[$i][0], Default, "")
    ; Process all properties of the item here
Next
_OL_Close($oOutlook)

How do you want to write the properties to a file? Which format?


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

At this point, I don't know if I'll use a text file with TABs or a SQLite database.

Currently, I just want to use a MsgBox to display the columns (properties) for a given record.

The MsgBox is empty:

For $i = 1 To 5
    $aItemProperties = _OL_ItemGet($oOutlook, $aResult[$i][0], Default, "")
    ; Process all properties of the item here
    MsgBox($MB_SYSTEMMODAL, "Item", $aItemProperties)
Next

Is $aItemProperties an array?

Edited by littlebigman

Share this post


Link to post
Share on other sites

You need to use _ArrayDisplay as _OL_Itemget returns an array!


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

But how do I extract an item and its properties from  _ArrayDisplay  and display them with MsgBox()?

I only started learning AutoIt a few days ago, so am a bit in the dark even for simple things.

Edited by littlebigman

Share this post


Link to post
Share on other sites
For $i = 1 To 5
    $aItemProperties = _OL_ItemGet($oOutlook, $aResult[$i][0], Default, "")
    _ArrayDisplay($aItemProperties) ; Display all properties of an item
    $sString = _ArrayToString($aItemProperties) ; Convert the array to a string
    MsgBox(0, "Properties", $sString) ; Display the string
Next

Displays all properties of a single item as an array and as a string.
As you can see each property (= each row of the array) has three values (=columns): name, value and typ of the property.
 


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hello,

Sorry, I didn't figure out how to only find posts related to OutlookEX that deal with the Notes folder.

I'd like to read all the items from the Notes section:

1. The Wiki only mentions "$olAppointment, $olContact, $olMail, and $olTask" for _OL_ItemFind().

2. Generally speaking, is there a document that lists the available columns that can be fetched from Outlook, eg. Subject, Body, LastModificationTime for Tasks ?

Thank you.

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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi Water. Thanks so much for the UDFs you have created- they have been immensly useful in my own projects. Kudos.

I have a quick question about your OutlookEx UDF:

Can it be made to return a complete list (as CSV) of someones calendar (who has shared "Full details" with me).

Currently I display those calendars in Grid view (Like a spreadsheet) and send CTRL A, CTRL C to those windows to capture all the appointments. I get the DATE, START TIME, END TIME and LOCATION fields (to extract postcodes to pass to a Routing API).

The main difficulty is that this method blocks the user imput while it is doing th CTRL A , CTRL C on multiple calendars, so was considering to use this UDF (Preferably, if that functionality is possible), or alternatively run an instance of Outlook in a virtual machine to prevent blocking the user input while capturing the details.

I hope all this makes sense... Thanks again,

Glumbler.

Share this post


Link to post
Share on other sites

Should be possible. Will have a look as soon as I return from vacation next week 😃


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@glumbler Maybe something like this:
Change: "Shared User Account Name" to User Account that has shared the Calendar.

#include <OutlookEX.au3>

Global $oOutlook = _OL_Open()
Global $sFileOpen = @ScriptDir & "\FileName.csv"
Global $hFileOpen = FileOpen($sFileOpen, 2)
Global $sFileItem

Global $aCalendar = _OL_FolderAccess($oOutlook, "\\Shared User Account Name\", $olFolderCalendar)

For $oCalendar In $aCalendar[1].Items
    $sFileItem = '"' & $oCalendar.Subject & '","' & _DateTime($oCalendar.Start) & '","' & _DateTime($oCalendar.End) & '","' & $oCalendar.Location & '"'
    FileWrite($hFileOpen, $sFileItem & @CRLF)
    ConsoleWrite($sFileItem & @CRLF)
Next
ShellExecute($sFileOpen)

Func _DateTime($_sDateTime)
    Return StringFormat("%02d/%02d/%4d %02d:%02d:%02d", StringMid($_sDateTime, 5, 2), StringMid($_sDateTime, 7, 2), StringLeft($_sDateTime, 4), StringMid($_sDateTime, 9, 2), StringMid($_sDateTime, 11, 2), StringRight($_sDateTime, 2))
EndFunc

 

Share this post


Link to post
Share on other sites

Hi Water,

I am trying to send an encrypted email. It all works great , but if the recipient dosnt have certificates, the script is paused on .Send and a outlook box ask if you want to cancel or send the mail unencrypted. How can i fix that?

encryption-problems.png

Share this post


Link to post
Share on other sites

Will have a look on Monday when I return to my office 😃


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Can you please post the part of your script where you encrypt the mail?


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Here it is:

With $OutMail
                    .To = $CmdLine[1]
                    .Subject = $CmdLine[2]
                    .Body = $sFileRead
;~                     1=encrypt 2=sign 3=both
                    .PropertyAccessor.SetProperty($PR_SECURITY_FLAGS, 3)
                    .send
                EndWith

 

Share this post


Link to post
Share on other sites

I have searched the web high and low and it seems that the only solution at the moment is to extend your call to _OL_Open and specify a program to click the needed button.
_OL_Warnings.au3 is an example how to click away some security pop ups.

On the other hand I'm not sure it is a good idea to send messages as unencrypted/unsigned when they should be encrypted and signed for users with a certificate.


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-21 - Version 0.6.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
33 minutes ago, water said:

I have searched the web high and low and it seems that the only solution at the moment is to extend your call to _OL_Open and specify a program to click the needed button.
_OL_Warnings.au3 is an example how to click away some security pop ups.

On the other hand I'm not sure it is a good idea to send messages as unencrypted/unsigned when they should be encrypted and signed for users with a certificate.

I will try it and see if it is OK. Clicking the cancel button is ok for me, but as the execution is stopped on the send line i am not sure the outlook warnings will work - i will have to do a script calling script and waiting for the popup thing. At the moment i wait 5min and if outlook is still active i assume user doesnt have cert. and kill it.

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