Jump to content

OutlookEX UDF


water
 Share

Recommended Posts

If you run _OL_ItemGet for such an "deleted" item, do you see any property like "IsDeleted" or something similar?

Or it might be a property hidden to COM. I mean a property where you need to use the property accessor to get the value.

All properties can be found here and there are a lot with "delete" in the name.

Needs some more investigation ...

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

Nothing that I can see, here's what ItemGet Returns on an email marked for deletion:

[1]|Actions||0
[2]|AlternateRecipientAllowed|True|6
[3]|Application||0
[4]|Attachments||0
[5]|AutoForwarded|False|6
[6]|AutoResolvedWinner|False|6
[7]|BCC||1
[8]|BillingInformation||1
[9]|Body||1
[10]|BodyFormat|1|3
[11]|Categories||1
[12]|CC||1
[13]|Class|43|3
[14]|Companies||1
[15]|Conflicts||0
[16]|ConversationIndex|01CD22551399541CC58A3678419CBFEFCC7CCAC6EA86|1
[17]|ConversationTopic||1
[18]|CreationTime|20120425143009|5
[19]|DeferredDeliveryTime|45010101000000|0
[20]|DeleteAfterSubmit|False|6
[21]|DownloadState|1|3
[22]|EntryID|00000000871EC33D92F3AA49B908F0334225805BC4292000|1
[23]|ExpiryTime|45010101000000|0
[24]|FlagRequest||1
[25]|FormDescription||0
[26]|GetInspector||0
[27]||1
[28]|Importance|1|3
[29]|InternetCodepage|28591|3
[30]|IsConflict|False|6
[31]|IsMarkedAsTask|False|6
[32]|ItemProperties||0
[33]|LastModificationTime|20120425143743|5
[34]|Links||0
[35]|MarkForDownload|0|3
[36]|MessageClass|IPM.Note|1
[37]|Mileage||1
[38]|NoAging|False|6
[39]|OriginatorDeliveryReportRequested|False|6
[40]|OutlookInternalVersion|0|3
[41]|OutlookVersion||1
[42]|Parent||0
[43]|Permission|0|3
[44]|PermissionService|0|3
[45]|PropertyAccessor||0
[46]|ReadReceiptRequested|False|6
[47]|ReceivedByEntryID||0
[48]|ReceivedByName|Bam|1
[49]|ReceivedOnBehalfOfEntryID||0
[50]|ReceivedOnBehalfOfName|Bam|1
[51]|ReceivedTime|20120424160146|5
[52]|RecipientReassignmentProhibited|False|6
[53]|Recipients||0
[54]|ReminderOverrideDefault|False|6
[55]|ReminderPlaySound|False|6
[56]|ReminderSet|False|6
[57]|ReminderSoundFile||1
[58]|ReminderTime|45010101000000|0
[59]|RemoteStatus|0|3
[60]|ReplyRecipientNames||1
[61]|ReplyRecipients||0
[62]|Saved|True|6
[63]|SaveSentMessageFolder||0
[64]|SenderEmailAddress||1
[65]|SenderEmailType|SMTP|1
[66]|SenderName||1
[67]|SendUsingAccount||0
[68]|Sensitivity|0|3
[69]|Sent|True|6
[70]|SentOn|20120424160138|5
[71]|SentOnBehalfOfName||1
[72]|Session||0
[73]|Size|9560|3
[74]|Subject||1
[75]|Submitted|False|6
[76]|TaskCompletedDate|45010101000000|0
[77]|TaskDueDate|45010101000000|0
[78]|TaskStartDate|45010101000000|0
[79]|TaskSubject||1
[80]|To|Bam|1
[81]|ToDoTaskOrdinal|45010101000000|0
[82]|UnRead|False|6
[83]|UserProperties||0
[84]|VotingOptions||1
[85]|VotingResponse||1

I tried _OL_ItemGet($oOL, $aItems[1][0], $aFolder[3], "1728184331")

and _OL_ItemGet($oOL, $aItems[1][0], $aFolder[3], "PR_BEING_DELETED")

They returned nothing.

Edited by Bam
Link to comment
Share on other sites

You can't use _OL_ItemGet this way. The properties you pass as parameter 4 must be properties exposed to COM. PR_* properties are not.

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

hi,water

i found the func _OL_ItemRecipientAdd has a problem.

$oOL_Recipient.Resolve

If @error <> 0 Or Not $oOL_Recipient.Resolved Then Return SetError(4, $iOL_Index, 0)"

now i delete them.because when i use the exchange server in my company.

the $oOL_Recipient.Resolve will return an error when i _OL_ItemSend

because two person has the same name. Resolve will be wrong.

so i would rather write the full name email address. then the _OL_ItemSend will very OK!

my outlook is 2007.

Edited by wokao98
Link to comment
Share on other sites

Hi wokoa98,

that's right. You can enter a name, alias or SMTP address wo add a recipient. If the name is not unique then there is no way for the UDF to determine which recipient to add.

I'm writing a new function _OL_ItemResolve that returns an array of resolved names. You then can select the SMTP address of the recipient you want to send the mailt etc. to.

At the moment there is no automated way.

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

  • 2 weeks later...

Hello! I've discovered how to add a folder from the Public Folders list to the Favorites list in Outlook using Outlook UDF (very cool and useful btw!). However, I also need to check the box that states Show this folder as an e-mail Address Book for this folder (right click on a Contact type folder in Public Folders area, select Properties, click Outlook Address Book tab, and check the box that states Show this folder as an e-mail Address Book).

Is this possible to do with Outlook UDF, and if so, can someone please help me set this up?

Thanks!

Edited by aakashshah
Link to comment
Share on other sites

Sure,

you have to set this property of the folder using _OL_FolderModify. Use something like:

_OL_FolderModify($oOL, $vOL_Folder, "", Default, "", Default, "", True)

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

Thanks for responding Water! Sorry, I wasn't sure how this would be used. If I have a public folder at "Public FoldersAll Public FoldersSome Contacts Folder", how would I use this? I tried the following:

$objOutlook = _OL_Open()
$vOL_Folder = "Public FoldersAll Public FoldersShared Contacts Folder"
_OL_FolderModify($objOutlook, $vOL_Folder, "", Default, "", Default, "", True)
If @error <> 0 Then Exit MsgBox(16, "Outlook Script", "Error: " & @error)
_OL_Close($objOutlook)

I got no error message, and it unfortunately didn't check the box "Show this folder as an e-mail Address Book".

I tried to find some documentation on "_OL_FolderModify", but I couldn't find any (I may have missed it).

Please let me know what I am doing wrong?

Thanks!

Sure,

you have to set this property of the folder using _OL_FolderModify. Use something like:

_OL_FolderModify($oOL, $vOL_Folder, "", Default, "", Default, "", True)

Link to comment
Share on other sites

In Outlook 2010, the "Public Folders" folder is titled "Public Folders - <user's email address>" (in Outlook 2003, it is titled simply "Public Folders". I am able to use "_OL_FolderAccess" and ".AddToPFFavorites" to add a Public Folder item in Outlook 2003. But in Outlook 2010, the same script fails since the path is different (it includes the email address). Can Outlook UDF reference the "Public Folders" folder in Outlook 2010 without needing to specify the exact path that includes the email address in Outlook 2010 (perhaps with a constant of some sort)?

Thanks again!

Edited by aakashshah
Link to comment
Share on other sites

Unfortunately there i no way I know of. But you could check for the Outlook version and then build the path accordingly.

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

Thanks for the confirmation. Unfortunately the email addresses do not follow a pattern and so building this will be a little harder. Is there a way to iterate through each root folder and filter for any items that are prefixed with "Public Folders" to help identify this?

And when you have a moment, can you please help with post #208?

Thanks!

Unfortunately there i no way I know of. But you could check for the Outlook version and then build the path accordingly.

Link to comment
Share on other sites

If you have defined the access to the public folder in your profile or you have done it manually then you can run function _OL_StoreGet.

Type = 2 in column[1] denotes an Exchange Public Folder.

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

Can you try this code:

#include <OutlookEX.au3>

$objOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "Outlook Script", "_OL_Open error: " & @error & ", @extended: " & @extended)

Global $vOL_Folder = "Public Folders\All Public Folders\Shared Contacts Folder"
$aFolder = _OL_FolderAccess($objOutlook, $vOL_Folder)
If @error <> 0 Then Exit MsgBox(16, "Outlook Script", "_OL_FolderAccess error: " & @error & ", @extended: " & @extended)

_OL_FolderModify($objOutlook, $vOL_Folder, "", Default, "", Default, "", True)
If @error <> 0 Then MsgBox(16, "Outlook Script", "_OL_FolderModify error: " & @error & ", @extended: " & @extended)

_OL_Close($objOutlook)

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

Water: Your code worked with no errors. I compared it with my old code and discovered that I had specified the wrong location (I was using the Outlook 2010 location with the email address in Outlook 2003). My apologies for the mixup! So it appears that the variable $vOL_Folder does not need to be Global from my test since it worked for me without it.

For my documentation and knowledge, can you please indicate what each of the parameters signifies in the following line of code:

_OL_FolderModify($objOutlook, $vOL_Folder, "", Default, "", Default, "", True)

Thanks!

Can you try this code:

#include <OutlookEX.au3>

$objOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "Outlook Script", "_OL_Open error: " & @error & ", @extended: " & @extended)

Global $vOL_Folder = "Public FoldersAll Public FoldersShared Contacts Folder"
$aFolder = _OL_FolderAccess($objOutlook, $vOL_Folder)
If @error <> 0 Then Exit MsgBox(16, "Outlook Script", "_OL_FolderAccess error: " & @error & ", @extended: " & @extended)

_OL_FolderModify($objOutlook, $vOL_Folder, "", Default, "", Default, "", True)
If @error <> 0 Then MsgBox(16, "Outlook Script", "_OL_FolderModify error: " & @error & ", @extended: " & @extended)

_OL_Close($objOutlook)

Edited by aakashshah
Link to comment
Share on other sites

Right. The Global was just necessary for my test environment because I like when variables are properly defined before beeing used.

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

Ahh! Very nice! I'll try to implement this and see if I can get it to work (I'm new to AutoIt and Outlook UDF).

I appreciate your prompt responses and your help with all of my questions! Thanks!

If you have defined the access to the public folder in your profile or you have done it manually then you can run function _OL_StoreGet.

Type = 2 in column[1] denotes an Exchange Public Folder.

Link to comment
Share on other sites

  • 4 weeks later...

Question about email with two embedded screen captures (PNG files) and _OL_ItemSave

When I try to use ItemSave I get a crash with ...

D:Documents and SettingsboucdavwMy DocumentsAuto programsPrint Emailsoutlookex.au3 (3427) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

If FileExists($sOL_Drive & $sOL_Dir & $sOL_FName & "_" & $aOL_Temp[1] & "_" & $iOL_Index2 & "." & $aOL_Temp[2]) = 0 Then ExitLoop

If FileExists($sOL_Drive & $sOL_Dir & $sOL_FName & "_" & $aOL_Temp[1] & "_" & $iOL_Index2 & "." & ^ ERROR

I ran _OL_ItemAttachmentget and returned the array below,

[0]|2|7|||||

[1]||Picture (Device Independent Bitmap)|||161|949613|6

[2]||Picture (Device Independent Bitmap)|||223|1025901|6

I am guessing there is something missing from the ItemAttachmentGet call that is causing the Itemsave to crash

Any suggestions?

Modified outlookex.udf with the following around line 3427 and seems to be working

For $iOL_Index2 = 1 To 99

If $aOL_Temp[0] = 1 Then ;change

ReDim $aOL_Temp[5] ;change

$aOL_Temp[2] = "unknown" ;change

EndIf ;change

If FileExists($sOL_Drive & $sOL_Dir & $sOL_FName & "_" & $aOL_Temp[1] & "_" & $iOL_Index2 & "." & $aOL_Temp[2]) = 0 Then ExitLoop

also modified line 3402, added a

$sOL_FName = StringRegExpReplace($sOL_FName, '[ /:*?"<>|]', '_') ;change

Edited by DavidFromLafayette
Link to comment
Share on other sites

I think it's a bug. The attachment has a displayname but no filename. _OL_ItemSave processes the filename und because there is none $aOL_Temp[2] does not exist and hence the script crashes.

I will have to change the function.

Will post a solution as soon as I have one.

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

I ran _OL_ItemAttachmentget and returned the array below,

[0]|2|7|||||

[1]||Picture (Device Independent Bitmap)|||161|949613|6

[2]||Picture (Device Independent Bitmap)|||223|1025901|6

As the array only contains a displayname but no filename/extension how should I determine the filename/extension to save the file?

I will add a new error code to handle such attachments.

You could use function _OL_ItemAttachmentSave where you can pass the index of the attachment to save plus a full path (drive, directory[, filename]) where to save the attachment.

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

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