Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

Parameter $bShowProgress is set to False or you use the default setting?

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

Parameter $bShowProgress is set to False or you use the default setting?

Oh god, you're right. $bShowProgress was set to True. I just took the code from _OL_ItemSendReceive.au3 into my script. Changed to False, and the popup windows are gone. Many thanks.

BTW, OutlookOE doesn't have a simple ItemReceive, does it? That would be sufficient in my case, as Outlook is set to send immediately. So the local email server is always uptodate.

Link to comment
Share on other sites

That's one single method to send and receive all pending items. You can't just receive new items.

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

Continuing with this >thread 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

I have a nother example how to handle "Send" events. I will post as soon as I'm back in my office again.

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

Hello,

Trying to reschedule a repeating meeting which seems to work OK using _OL_ItemRecurrenceSet but we found a problem in that if we use _OL_ItemSend to send the notifications then there will be 2 meeting items listed in the Outlook calendar.  If we don't send then users on the other end don't receive the meeting update.

Any suggestions for updating the meeting schedule and sending out updates without getting a new entry on the Calendar?

Thanks.

Link to comment
Share on other sites

Can you please post your code so I can have a look?

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

Stripped down but basically:

Global $oOL = _OL_Open()
$aResult = _OL_ItemFind($oOL, "*Calendar", $olAppointment, "[subject]='" & $sSubject & "'", "", "", "EntryID")
$aPatten = _OL_ItemRecurrenceGet($oOL, $aResult[1][0], Default)
$oItem=_OL_ItemRecurrenceSet($oOL, $aResult[1][0], Default, $sStartDate, $sStartTime, int($sCount), $sEndTime, $sFREQ, $iDayOf, "", "")
_OL_ItemSend($oOL, $oItem)
_OL_Close($oOL)

Link to comment
Share on other sites

Water was kind enough to direct me here when I posted in the wrong forum location.
 
I am creating an outlook macro that launches a compiled autoit script that will manipulate the sent email.  I can pass the EntryID to the script as a command line parameter as follows:
 
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Shell ("C:TMRTest3.exe " & Item.EntryID)
End Sub
 
The parameter is accessible to the script in the $CmdLine array.  $CmdLine[1] holds the first command line item, or the EntryID..
 
Interestingly enough, the script seems to have some problem with the EntryID it obtains as a command line parameter.  It appeared there would be no problem, but when I run the following I get an error (@error = 2) showing that the item could not be found.
 
Global $oOutlook = _OL_Open()
Global $aOL_Properties = _OL_ItemDisplay($oOutlook, $CmdLine[1])
 
I have a working version of a script that waits in the background and captures a sent item for manipulation.  I have been using this myself for a long time.  It works well and I can continue to use it.  However, on a rare occasion an error may occur in the script due to something unexpected and it must be restarted.  With the approach I am pursuing the script would be run fresh every time an email is sent and it would be very fault tolerant and use fewer system resources.  The EntryID would be passed to the script and the email manipulated accordingly.
 
I have a second script that I use for received emails where I select the emails to be manipulated and then use a macro to launch the script.  It is more fault tolerant than my sent email script.  It is what I am trying to pattern this rebuild around.
 
I have two ideas:
 
it seems possible that the EntryID is changing from the one I am collecting with the macro.  My research shows that the EntryID changes when an email is moved from folder to folder.  Perhaps the EntryID the macro is returning is the one given when it is in the outbox before it goes to the sent items folder.  The method in the macro is "Application_ItemSend" and I believe allows manipulation of the email before it is actually sent.  That would account for the script being unable to locate the item based on that EntryID.  What I really need is an "Application_ItemSent" method, though that does not exist.  Alternatively a way to tell the macro to send the email and then poll the EntryID from the Sent Items folder.  
 
Alternatively, I would need a some programming in the script to identify and return the EntryID of the most recently sent email.
 
Any help on either of these approaches would be greatly appreciated.
Link to comment
Share on other sites

pfiore,

can you please write the value of @error and @extended after each call of a _OL_* function to the Console?

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

SkoubyeWan,
the EntryID is created whenever an item is created in a folder. This means that the event gets the EntryID of the item from the drafts folder. When it is then being sent it is moved to the sent items folder and gets a new EntryID.
You could try to pass the item object to your script (not sure if this works) and then get the new EntryID if needed.

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

Okay.  I got this worked out.  Instead of using the _ItemSend method, I use the _ItemAdd method.  In this way, the EntryID doesn't change.

Here is the Outlook Macro code for triggering the AutoIt script:

Option Explicit

Public WithEvents oSentItems As Items
 
Public Sub Application_Startup()
    Set oSentItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub
 
Private Sub OSentItems_ItemAdd(ByVal Item As Object)
  Shell ("C:\TMR\TMR-SaveSentEmailsNow.exe " & Item.EntryID)
End Sub

Here is a simplified script code showing how the EntryID can be used in the script:

#include <OutlookEX.au3>
#include <Array.au3>

$oOL = _OL_Open()
$EntryId = $cmdlineraw
$Item = _OL_ItemGet($oOL, $EntryId,Default,"Subject,SenderName,To,SentOn")
_ArrayDisplay($item)

_OL_Close($oOL)

Hope this helps someone else.

Link to comment
Share on other sites

Thanks for the info!

Is "olFolderInbox" correct? Shouldn't it be "olFolderSentMail" to monitor sent mails? If I'm not wrong then olFolderInbox monitors incomming new mails?

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

What's the value of @error you get displayed in the msgBox?

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

Great, that's a bug!

As you can see there are 5 rows and 5 columns in the array ([5][5]). The parameters for _ArrayDisplay have changed, but I still haven't changed all example scripts.

Replace

_ArrayDisplay($aResult, "OutlookEX UDF: _OL_AddressListGet Example Script - All address lists", _
    -1, 0, "", "|", "Row|OlAddressListType|Name|Index|Resolving order|Identifier")

with

_ArrayDisplay($aResult, "OutlookEX UDF: _OL_AddressListGet Example Script - All address lists")

I will change the examples as soon as most users have upgraded to version 3.3.10.2 of AutoIt (because the fixed examples won't run with 3.3.8.1).

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

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...