Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

Fixed It :) All I had to do was read the supplied documentation :> and use the function _OL_ItemRecipientGet and it works nicely.

So going forwards I need to get the MessageClass property for each MSG file being processed. If the class is IPM_Note then use the _OL_ItemGet function to retrieve the recipient list. If the class is a meeting then use the _OL_ItemRecipientGet function instead.

As I said I have over 4.8 Million emails spanning 12 years to process so it will certainly give your code a good test run. 

 

 

Link to comment
Share on other sites

Glad your problem could be solved :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

  • 4 weeks later...

Hello Water,

 

Can you provide a location where a list of all of the return Property Names can be found for Ol_Item_Find, I have several that I need to return but am having no luck finding a list of all of the available ones for email and contacts.

One Such example would be for a Mail item, the Folder  that the item is stored in Outlook

Please let me know.

 

Thanks

Paul

Edited by HighlanderSword
Link to comment
Share on other sites

There different properties for different items. Example:
Outlook 2010, MailItem: https://msdn.microsoft.com/en-us/library/ff870913(v=office.14).aspx

Outlook 2010 Object Model Reference: https://msdn.microsoft.com/en-us/library/ff870566.aspx

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 do you pass Parent.Folderpath to _OL_ItemFind?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

The function doesn't work this way. It checks the properties to be returned and sets @error to 100x when a property is unknown. 

You can only retrieve Parent and then retrieve Parent.FolderPath in a second step.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

  • 4 weeks later...
On 13/05/2017 at 8:28 PM, water said:

You could add some additional error checking (plus I added a save statement):

$oItem = _OL_ItemCreate($oOutlook, $olMailItem)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating item. @error = " & @error & ", @extended = " & @extended)
$oItem.BodyFormat = $olFormatHTML
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error modifying item. @error = " & @error & ", @extended = " & @extended)
$oItem.Save() ; Added because the item has been modified.
$sOrigBody = $oItem.HTMLBody
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error saving the body to a variable. @error = " & @error & ", @extended = " & @extended)

 

Sorry for the late reply, the error comes to the last step of saving body:

Error saving the body to a variable. @error = -2147467260, @extended = 0

Googled the error  -2147467260, looks like it's related to access permission. I'm in the local administrators group, not sure what kind of permission is required here...

 

Link to comment
Share on other sites

This error code stands for: "Exception from HRESULT: 0x80004004 (E_ABORT)".
Unfortunately Google Returns a lot of explanations for this code :( 

Can you please add this line after _OL_Open so we get more detailed error Information?

_OL_ErrorNotify(2)

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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

  • 4 weeks later...

Hello all,

This seems to be an interesting UDF overall. Can someone point me on how to 'CREATE an outlook profile' through this UDF. I was trying to search for '_OL_CreateProfile' - but couldn't really get anything closer. Any help would be greatly appreciated..

Thanks

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

Unfortunately you can't create profiles with this UDF - that's an Outlook limitation.
But you can create a text file and start Outlook with command line switch "/importprf prffilename" to create the profile for you.

How to to create a PRF file can be found here (and many other places): https://technet.microsoft.com/en-us/library/cc179062(v=office.14).aspx

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 07/12/2016 at 3:18 PM, Raffav said:

Some progress, but new error

error 501 / extended 400 

PS: iam using  multiple imap accounts

 

Capture.PNG

@water 

Good day I need one more help from you

i qouted one of our talk so you can remembering the case, 

i was getting some problems with the udf and after some debug you find the fix, 

now I am getting the same error error 501 / extended 400  on a different pc, I run the step to get some Com debug and one messanger is different  i will post it a soon I get to my pc,

i even copy the same version outlookEx/constants from working pc. No success.

 

 

 

Link to comment
Share on other sites

error 501 is set by function _OL_TestEnvironmentCreate.
extended 400 is returned by _OL_ItemRecipientAdd and stands for: Recipient name could not be resolved.
What is the value of

$sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 minutes ago, water said:

error 501 is set by function _OL_TestEnvironmentCreate.
extended 400 is returned by _OL_ItemRecipientAdd and stands for: Recipient name could not be resolved.
What is the value of

$sCurrentUser = $oOL.GetNameSpace("MAPI").CurrentUser.Name

 

@water

yes, you have made some change, to remember go to my quote and read from there.

just a min I will post your request 

 

Link to comment
Share on other sites

Short answer: No. 

You need to check which protocols are supported by Exchange (Pop3, IMap) and then check the UDF section in the wiki for an UDF that fits your needs. 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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 09/12/2016 at 11:23 AM, water said:

I needed to change two things:

  • The item needs to be saved before we can access certain properties
  • We need to modify other words in the mail template
#include <OutlookEX.au3>

Global $oItem
Global $oOutlook = _OL_Open()
Global $Result = _OL_TestEnvironmentCreate($oOutlook)

$oItem = _OL_ItemCreate($oOutlook, $olMailItem, "*\Outlook-UDF-Test\TargetFolder\Mail", @ScriptDir & "\_OL_ItemCreate.oft")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = " & @error & ", @extended = " & @extended)
$oItem.Save()
; Retrieve the current mail body (HTML)
$sHTML = $oItem.HTMLBody
; Modify place holders
$sHTML = StringReplace($sHTML, "Example mail", "Exemplo de correio")
$sHTML = StringReplace($sHTML, "template", "modelo")
; Rewrite the mail body
$oItem.HTMLBody = $sHTML
; Display the changed item
$oItem.Display

 

@water

The 1 problem i figure out i need to create  a contact with my name is a way to bypass this?

2 problem now, the HTML is not being edited  

on my work pc it works , but my both home pc dont.

on home pc i am not getting  the outlook security alert to permit or deny the access,

 

any suggestion ?

 

 

 

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...