Jump to content
water

OutlookEX UDF - Help & Support (IV)

Recommended Posts

After struggling for a while, I was able to get _OL_ItemMove to work.  However, I want to understand why what I did worked.

Old Code

$TargetFolder = _OL_FolderAccess($oOutlook,"First.Last@Company.com\Inbox\Processed",$olFolderInbox)
$oItem = _OL_ItemMove($oOutlook, $aItems[1][2], Default, $TargetFolder)

Working Code

$TargetFolder = _OL_FolderAccess($oOutlook,"First.Last@company.com\Inbox\Processed",$olFolderInbox)
$oItem = _OL_ItemMove($oOutlook, $aItems[1][2], Default, $TargetFolder[1])

I didn't know $TargetFolder was an array.  Also, I don't understand why it's [1].  When I display the array the target folder shows up on row 5.

Share this post


Link to post
Share on other sites

That's why I always suggest to read the help file ;)
Element 1 of the returned array holds the folder object, element 5 holds the folderpath.
_OL_ItemMove can handle the folder object and the folder name.


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

Hello water,

I am trying to use "_OL_ItemAttachmentSave" to download .pdf attachments (one per email) from a folder in my Outlook 2010 containing 100 emails.

Is this possible to do using your UDF?

Thank you for your time and any suggestions and/or examples you can provide.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

I would try to create a new item using _OL_ItemCreate and specify the mail file as template. Then process the returned mail item as needed and when finished delete the created item.
Haven't tested this approach, so it might be buggy ;)


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

Hi water

First-I want to thank you for this UDF. I have used it for years as part of a system scan/backup report generation AutoIt program for crystal reports script-to run and send backup reports when the primary system fails as well as results for system scans for a major hospital group in Michigan.

I've looked - and am unable to find the answer to a question.

We are being pressed to upgrade to Outlook365 - I was wondering if you know if the current version will work with Office 365's Outlook- simple functions like sending an email with a body and attaching files.  Beyond that, I don't use any of the functionality in the UDF.

 

thank you again for the UDF!

Share this post


Link to post
Share on other sites

I'm not sure the cloud based Office365 offers a COM interface.
I have no Office365 available so can't test.
If you can test, try:

#include <OutlookEX.au3>
Global $oOutlook = _OL_Open()
MsgBox(0, "_OL_Open", "@error = " & @error & ", @extended = " & @extended)

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
2 hours ago, water said:

I'm not sure the cloud based Office365 offers a COM interface.
I have no Office365 available so can't test.
If you can test, try:

#include <OutlookEX.au3>
Global $oOutlook = _OL_Open()
MsgBox(0, "_OL_Open", "@error = " & @error & ", @extended = " & @extended)

 

this one is when Outlook is open

Capture.PNG.e0ecf40306b271606443f23ed005ee96.PNG

 

 

this one is when outlook is closed

Capture2.PNG.c138fc5b1f82b5a2a25bf69c130e6b03.PNG

outlook 365 installed and operational. if you have more test code you want to try, let me know.

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

Looks good. So I think everything else should work as well :)


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

Version 1.3.4.0 of the UDF has been released.

  • General code enhancements
  • FIXED BUGS: _OL_PSTAccess: On error 4 Exit was used instead of Return. So this error ended your whole script.
  • CHANGED FUNCTIONS: _OL_PSTAccess: Now works with PST-files on network drives, though it is not recommended by Microsoft.
    Internal function __OL_PSTConvertUNC added to convert PST filepaths to UNC notation.

Please test before using in production!

For download please see my signature.

Edited by water

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

Hi

Concerning OutLook and RTF email, I have the following:

Rich Text Format (RTF) Specification
Version 1.9.1 

which can be downloaded from Microsoft in .doc and .docx format. (sic) Not in RTF, funny that,

pages 63-71 indicate that a compliant RTF interpreter will convert Mail Merged RTF documents into HTML and pass the object to Outlook if the merge Destination is email. 

It appears that Outlook (not the UDF, the Microsoft Application) cannot send RTF email in native format.  Outlook sends email in HTML format.

Which probably indicates that our attempts at sending RTF email is futile.

Quote

\mmdestemail

Specifies that conforming hosting applications shall generate emails using the documents that result from populating the fields within a given merged RTF document with data from the specified external data source.

Skysnake

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

Sorry, I don't see how this is related to the OutlookEX UDF :huh:


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

Hi, 

I need your help:

I open Outlook 2013 using Run and activate the window with

 WinActivate(MessageText)
 WinWaitActive(MessageText, "", 10)

problem is that I can not select the first email from Inbox.

Thanks.

Share this post


Link to post
Share on other sites

This means you do not use the OutlookEX UDF at all?
How do you try to select the first email of your inbox? Post the code please.


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

Sure, (I used dll library because I write in c# )

public void Outlook()
        {

            autoit.Run("C:\\Program Files (x86)\\Microsoft Office\\Office15\\outlook.exe");
            autoit.WinActivate(MessageText);
            
            string windowName = "Inbox - ";
            int found = autoit.WinWait(windowName, "", 10);
            if (found != 0)
            {
                autoit.WinActivate(windowName);
                
                autoit.Send("{ENTER}");
                autoit.Send("{TAB}");

            }
        }

Share this post


Link to post
Share on other sites

I see.
Then I think the following forum is the best place to get some help: https://www.autoitscript.com/forum/forum/14-autoitx-help-and-support/


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

What is the shorder way to send an email with X subject and Y body please ?

To be a bit more explicit make an email in my script directly or in hdd and then send it. the mail whould be very shord so it can be from my script.

 

Just need function orders please thanks

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - 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
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Posted (edited)

Version 1.3.5.0 of the UDF has been released.

Please test before using in production!

For download please see my signature.

Edited by water

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

Hello.  I would like to use your UDF to automate some simple Outlook tasks.  I am getting started, and have a few specific questions about one of your functions and its parameters. Would this be the place to ask?

My specific question is in relation to the _OL_ItemCreate() function.  The first parameter it takes is $oOL, which is defined as, "the Outlook object returned by a preceding call to _OL_Open()."  But in my case, I have not explicitly called _OL_Open().  In my case, Outlook has already been opened manually.  So what do i specify for $oOL here?

I tried explicitly calling _OL_Open().  But when I did so while Outlook was already opened, it seemed to cause issues.  Namely, the script remained 'paused' in my systray, and no code after _OL_Open() seemed to execute.  Perhaps I am misunderstanding something though.

Thanks.

Share this post


Link to post
Share on other sites

This is definitely the place to ask questions :)

_OL_Open needs to be the first function to call in a script. If Outlook is already running then _OL_Open connects to this instance, else a new instance of Outlook is being created.

Can you please post your script (or at least the part where you call _OL_Open)?


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