Jump to content

OutlookEX UDF


water
 Share

Recommended Posts

If someone wants to play with setting the default form for a folder, here is the function:

Test_OL_FolderClassSet.au3

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

Any comments on this function or forms in general?

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

  • 4 weeks later...

I have used this OutlookEx UDF and it works great.  I really appreciate the work that was put into this.

I have a question regarding a script that I wrote that is currently not using the Outlook UDF (Although I use it in other situations perfectly)

Here is my dilemma I often have to configure email accounts in Outlook (Meaning create a new account)  Often times I need to create multiple accounts because I work with vendors who require me to have their email accounts I have to configure 20-25 separate email accounts into outlook for myself and a few others.  As you can imagine it is a pain to do this.  So I created this script that reads an Excel sheet and will load 25 accounts in around 2 minutes.  That works great if when it is ran people will leave it alone and let it finish. 

Because I have to deal with the Outlook GUI it must stay focused and activate certain windows. 

I would like to move this script further along and have it run like something out of OutlookEX and run without send key strokes and such. 

I am an amateur Autoit user but I get the jest.  I am having a hard time finding away to automate this script a bit further.

Any help would be greatly appreciated.

#include <Excel.au3>
;#include <array.au3>

;_Singleton(@ScriptDir &"\Outlook Account Set up.au3", 0)
;declare file name
$sFilePath1= @ScriptDir & "\Oulook1.xlsx" ; This file should already exist

;make connection to Excel
$oExcel = _ExcelBookOpen($sFilePath1,0)

;Error Handling
If @error = 1 Then
    MsgBox(0, "Error!", "Unable to Create the Excel Object")
    Exit
    Elseif @error = 2 Then
    MsgBox(0, "Error!", "File does not exist - Shame on your!")
    Exit
EndIf

;read Excel files and store it in array
$aArray= _ExcelReadSheetToArray($oExcel,2,1,0,10,True)

$sSleep = 10
;open new account form in Outlook
WinActivate("Outlook Today - Microsoft Outlook","")
Sleep($sSleep)
Send("!T")
sleep($sSleep)
Send("A")


For $i = 1 to $aArray[0][0]

    ;just copy the array to hte variable for better reading

$sYourName = $aArray[$i][0]
$sEmail = $aArray[$i][1]
$sIncomingMS = $aArray[$i][2]
$sOutgoingMS = $aArray[$i][3]
$sUserName = $aArray[$i][4]
$sPassword = $aArray[$i][5]
$sIncomingPort = $aArray[$i][6]
$sSSLReq = $aArray[$i][7]
$sOutgoingPort = $aArray[$i][8]
$sEncryption = $aArray[$i][9]

;if one of the cells are empty then continue to the next row

If $sYourName = "" Or $sEmail = "" Or $sIncomingMS = "" Or $sOutgoingMS = "" Or $sUserName = "" Or $sPassword = "" Or $sIncomingPort = "" Or $sOutgoingPort = "" Or $sEncryption = '' Then ContinueLoop
ToolTip($i,0,0,"Adding The Follow Account",1,1)

WinActivate("Account Settings","")
Send("!n") ;opens Add New E-mail Account Window

WinWaitActive("Add New E-mail Account","&Other") ;wait for window to be active
;sleep(50)
Send("!n")

;check the manual Configure Server Settings box
WinWaitActive("Add New E-mail Account","&Password:")
;Sleep(50)
;ControlCommand("Add New E-mail Account","&Manually configure server settings or additional server types","[CLASS:Button; INSTANCE:1]","Check")
WinActivate("Add New E-mail Account","&Password:")
send("!m")
sleep($sSleep)

;Take to Next page to "Choose Email Service
send("!n")

;Skip this page and go to "Internet E-Mail Settings Page
WinActivate("Add New E-mail Account","&Microsoft Exchange")
sleep($sSleep)
send("!n")

;**************************************************************
;Start adding personalized information HERE
;**************************************************************
;Your Name
sleep($sSleep)
send("!y")
send($sYourName)
;************************************************************************
;Email Address
sleep($sSleep)
send("!e")
send($sEmail)
;************************************************************************
;Incoming Mail Server
sleep($sSleep)
send("!i")
send($sIncomingMS)

;Outgoing Mail Server
sleep($sSleep)
send("!o")
send($sOutgoingMS)

;User Name
sleep($sSleep)
send("!u")
send($sUserName)

;Password
sleep($sSleep)
send("!p")
send($sPassword)

;More Setting Tabs
sleep($sSleep)
send("!M")

;sleep(10)
send("{Tab 5}")

sleep($sSleep)
send("{Right 3}")

sleep($sSleep)
send("!e")

;Outgoing SMTP Port
sleep($sSleep)
send("!o")
send($sOutgoingPort)

;Sellect tls from drop down
sleep($sSleep)
send("!c")

sleep(50)
send($sEncryption)

;sleep (1)
;send("{Tab 3}")

sleep($sSleep)
controlclick("Internet E-mail Settings","OK",1,"",1)

sleep($sSleep)
controlclick("Add New E-mail Account","&Next >",12324,"",1)

sleep($sSleep)
controlclick("Add New E-mail Account","Finish",12325,"",1)

;Sleep(50)
_ExcelWriteCell($oExcel, @Mon & "/" & @MDAY & "/" & @YEAR & "-" & @HOUR & ":" & @MIN, $i + 1,13)

Next
_ExcelBookClose($oExcel)
ProcessClose("Excel.exe")
MsgBox(0,"Total Email Account","Total Email Account" &": "& $i - 1)
Link to comment
Share on other sites

Which Outlook version do you run?

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 searched Google and there seems to be no API to create accounts using AutoIt.

Looks like you have to write the data for new accounts into the registry.

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

Another approach could be to block the Console input while your script is running.

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

Or create a profile with the required accounts and start Outlook with the /importprf command line switch.

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 use an application that handles creating profiles using a logon script.

It will create a profile using dynamic parameters :

createPrf.exe Profile -Mailbox=YourServer@UserName -PST=Z:Your_Archive.pst

This is an extract of the HKCU keys that are created : 

Windows Registry Editor Version 5.00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile0a0d020000000000c000000000000046]
"000b0340"=hex(3):01,00
"0003033d"=hex(3):02,00,00,00
"00030372"=hex(3):02,00,00,00
"001e023d"="Whatever"
"001e0336"="IPF.Note"
"00030358"=hex(3):01,00,00,00
"1102032f"=hex(3):01,00,00,00,6F,00,00,00,0C,00,00,00,00,00,00,00,38,A1,BB,
10,05,E5,10,1A,A1,BB,08,00,2B,2A,56,C2,00,00,45,4D,53,4D,44,42,2E,44,4C,00,
00,00,00,00,00,00,00,1B,55,FA,20,AA,66,11,CD,9B,C8,00,AA,00,2F,C4,5A,0C,00,
00,00,47,42,30,30,35,58,48,00,2F,6F,3D,4D,41,46,46,2F,6F,75,3D,48,55,42,2F,
63,6E,3D,4D,6F,76,65,64,20,46,6F,6C,64,65,72,2F,63,6E,3D,61,78,39,30,34,31,
37,38,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile13dbb0c8aa05101a9bb000aa002fc45a]
"00036600"=hex(3):01,05,00,00
"00036601"=hex(3):04,00,00,00
"00036605"=hex(3):03,00,00,00
"00036604"=hex(3):02,00,00,00
"00036661"=hex(3):05,06,00,04
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d01"=hex(3):44,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d00"=hex(3):45,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,46,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d02"=hex(3):47,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,48,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e6607"="@UserName "
"001e6608"="YourServer"
"00036606"=hex(3):00,00,00,00
"0003661b"=hex(3):5D,0A,00,00
"00146686"=hex(3):80,F1,99,B7,B3,C1,C0,01
"01026611"=hex(3):06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,5A,D5,BE,BA,B4,4A,D5,11,89,C0,00,00,C0,A1,04,DE,01,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile42acdf40ca5b11cdb7ba00aa003cf7f1]
"000b6001"=hex(3):01,00
"00486003"=hex(3):7D,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile43fe161c8738d51189bc0000c0a104de]
"001e3001"="Microsoft Exchange Server"
"001e3d0a"="emsui.dll"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"001e3d0b"="EMSCfg"
"001e3009"=hex(3):02,00,00,00
"101e3d0f"=hex(3):03,00,00,00,10,00,00,00,1A,00,00,00,25,00,00,00,65,6D,73,
75,69,2E,64,6C,6C,00,65,6D,73,61,62,70,2E,64,6C,6C,00,65,6D,73,6D,64,62,2E,
64,6C,6C,00
"001e3d09"="MSEMS"
"01023d01"=hex(3):44,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d00"=hex(3):45,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,46,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d02"=hex(3):47,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,48,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d08"=hex(3):49,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d0d"=hex(3):13,DB,B0,C8,AA,05,10,1A,9B,B0,00,AA,00,2F,C4,5A
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile44fe161c8738d51189bc0000c0a104de]
"001e3001"="Microsoft Exchange Directory Service"
"001e3006"="Microsoft Exchange Directory Service"
"001e300a"="EMSABP.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex(3):23,00,00,00
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
"00033009"=hex(3):00,00,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile45fe161c8738d51189bc0000c0a104de]
"00033e03"=hex(3):21,00,00,00
"001e300a"="EMSMDB.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033009"=hex(3):40,00,00,00
"00036609"=hex(3):06,00,00,00
"0003660a"=hex(3):03,00,00,00
"01023414"=hex(3):78,B2,FA,70,AF,F7,11,CD,9B,C8,00,AA,00,2F,C4,5A
"001e3001"="Public Folders"
"001e3006"="Microsoft Exchange Message Store"
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
"001e660c"="YourServer"
"01020ff9"=hex(3):1A,44,73,90,AA,66,11,CD,9B,C8,00,AA,00,2F,C4,5A
"00036688"=hex(3):01,00,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile46fe161c8738d51189bc0000c0a104de]
"001e300a"="EMSMDB.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex(3):21,00,00,00
"00033009"=hex(3):06,10,00,00
"00036609"=hex(3):0C,00,00,00
"0003660a"=hex(3):01,00,00,00
"01023414"=hex(3):54,94,A1,C0,29,7F,10,1B,A5,87,08,00,2B,2A,25,17
"001e3006"="Microsoft Exchange Server"
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
"001e660c"="YourServer"
"01020fff"=hex(3):00,00,00,00,38,A1,BB,10,05,E5,10,1A,A1,BB,08,00,2B,2A,56,
C2,00,00,45,4D,53,4D,44,42,2E,44,4C,4C,00,00,00,00,00,00,00,00,1B,55,FA,20,
AA,66,11,CD,9B,C8,00,AA,00,2F,C4,5A,0C,00,00,00,4C,41,50,54,4F,50,31,00,2F,
6F,3D,53,43,2F,6F,75,3D,53,43,43,31,2F,63,6E,3D,4D,6F,76,65,64,46,6F,6C,64,
65,72,2F,63,6E,3D,4E,65,77,4D,00
"01020ff9"=hex(3):6E,5E,55,6F,92,8F,D4,11,BB,A0,00,80,C8,B9,26,70
"00036688"=hex(3):01,00,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile47fe161c8738d51189bc0000c0a104de]
"001e3001"="Microsoft Exchange Remote Transport"
"001e3006"="Microsoft Exchange Remote Transport"
"001e300a"="EMSUI.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"001e3e03"=hex(3):24,00,00,00
"00036609"=hex(3):40,00,00,00
"0003660a"=hex(3):0A,00,00,00
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
"00033009"=hex(3):00,00,00,00
"001e660c"="YourServer"
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile48fe161c8738d51189bc0000c0a104de]
"001e3001"="Microsoft Exchange Transport"
"001e3006"="Microsoft Exchange Transport"
"001e300a"="EMSMDB.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"001e3e03"=hex(3):24,00,00,00
"00036609"=hex(3):00,00,00,00
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
"00033009"=hex(3):00,00,00,00
"001e660c"="YourServer"
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile49fe161c8738d51189bc0000c0a104de]
"001e3001"="MS Exchange Hook"
"001e3006"="MS Exchange Hook"
"001e300a"="EMSMDB.DLL"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex(3):28,00,00,00
"00033009"=hex(3):00,02,00,00
"01023d0c"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="MSEMS"
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile4cfe161c8738d51189bc0000c0a104de]
"001e3d0a"="contab.dll"
"001e3d13"="{6485D266-C2AC-11D1-AD3E-10A0C911C9C0}"
"101e3d0f"=hex(3):01,00,00,00,08,00,00,00,63,6F,6E,74,61,62,2E,64,6C,6C,00
"001e3d0b"="ServiceEntry"
"00033009"=hex(3):22,00,00,00
"001e3d09"="CONTAB"
"001e3001"="Outlook Address Book"
"01023d01"=hex(3):4D,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile4dfe161c8738d51189bc0000c0a104de]
"001e300a"="contab.dll"
"001e3d13"="{6485D26A-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex(3):23,00,00,00
"001e3006"="Outlook Address Book"
"01023d0c"=hex(3):4C,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"001e3d09"="CONTAB"
"001e3001"="Outlook Address Book"
"00033009"=hex(3):00,00,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile8503020000000000c000000000000046]
"0102300b"=hex(3):42,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile9207f3e0a3b11019908b08002b2a56c2]
"01023d01"=hex(3):44,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,4D,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d00"=hex(3):45,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,46,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,01,D5,BE,BA,B4,4A,D5,11,89,C0,00,00,
C0,A1,04,DE
"01023d02"=hex(3):47,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,48,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d08"=hex(3):49,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d0e"=hex(3):43,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE,4C,FE,16,
1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
"01023d05"=hex(3):02,00,00,00,1E,00,00,00,14,00,00,00,5A,00,00,00,34,00,00,
00,00,00,00,00,DC,A7,40,C8,C0,42,10,1A,B4,B9,08,00,2B,2F,E1,82,01,00,00,00,
00,01,00,00,2F,00,00,00,00,00,00,00,FE,42,AA,0A,18,C7,1A,10,E8,85,0B,65,1C,
24,00,00,03,00,00,00,03,00,00,00,4F,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,
04,DE,00,00,00,00,61,0B,76,BD,CE,07,D5,11,99,B8,00,08,C7,9F,D5,1C,01,00,02,
64,24,38,BF,A5,D4,11,99,B2,00,08,C7,9F,D5,1C,00,00,00,39,52,74,00,00,00,00
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfilef86ed2903a4a11cfb57e524153480001]
"000b6001"=hex(3):01,00
"00486002"=hex(3):65,FE,16,1C,87,38,D5,11,89,BC,00,00,C0,A1,04,DE
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile00d5bebab44ad51189c00000c0a104de]
"001e3001"="Personal Folders"
"001e3d0a"="mspst.dll"
"001e3d13"="{6485D262-C2AC-11D1-AD3E-10A0C911C9C0}"
"101e3d0f"=hex(3):01,00,00,00,08,00,00,00,6D,73,70,73,74,2E,64,6C,6C,00
"001e3d0b"="PSTServiceEntry"
"00033009"=hex(3):20,00,00,00
"001e3d09"="MSPST MS"
"01023d00"=hex(3):58,D5,BE,BA,B4,4A,D5,11,89,C0,00,00,C0,A1,04,DE
 
[HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesProfile01d5bebab44ad51189c00000c0a104de]
"01023414"=hex(3):4E,49,54,41,F9,BF,B8,01,00,AA,00,37,D9,6E,00,00
"001e300a"="MSPST.DLL"
"001e3d13"="{6485D262-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex(3):21,00,00,00
"001e3001"="Personal Folders"
"001e3006"="Personal Folders"
"01023d0c"=hex(3):57,D5,BE,BA,B4,4A,D5,11,89,C0,00,00,C0,A1,04,DE
"001e3d09"="MSPST MS"
"00033009"=hex(3):00,08,00,00
"01020fff"=hex(3):00,00,00,00,38,A1,BB,10,05,E5,10,1A,A1,BB,08,00,2B,2A,56,
C2,00,00,6D,73,70,73,74,2E,64,6C,6C,00,00,00,00,00,4E,49,54,41,F9,BF,B8,01,
00,AA,00,37,D9,6E,00,00,00,7A,3A,5C,74,65,73,74,5F,61,72,63,68,69,76,65,2E,
70,73,74,00
"001e3004"=""
"001e6700"="z:Your_Archive.pst"
"01020ff9"=hex(3):F3,CC,1D,0E,E5,03,D5,11,89,93,00,00,C0,A1,04,DE

 
rgds,
ptrex

 

Link to comment
Share on other sites

  • 2 weeks later...

This maybe WAYY to general of a question.

But I have a user here that somehow had a huge junk of his emails duplicated (thousands I believe).

Would there be an easy way to index all the emails, cycle through them and tell if an email is a duplicate of one?

Link to comment
Share on other sites

Use _OL_ItemFind to retrieve all mails of a folder plus subfolders. Add EntryID to the data to be returned by the function. Set the sort parameter to subject or date or whatever lets you decide that two mails are equal.

Then process the returned array. Call _OL_ItemDelete and pass the EntryID of the item to be deleted.

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

  • 2 weeks later...
get the currently used Outlook profile in Outlook XP, 2003, 2007, 2010, 2013
 
ok, here goes:
 
see 5 functions:
 
the main function _OL_ProfileGetCurrent() is called by a script to return the currently used Outlook profile.
 
how it works:
 
it calls __OL_PSTGet_StoreID_FromOutlook() which returns a list of mail stores currently loaded to Outlook.
 
regardless, it calls __OL_ProfileGetRegKey() which returns the registry key where Outlook profiles are stored.
 
for every profile stored in the registry, a list of mail stores is produced.by calling __OL_PSTGet_StoreID_FromRegistry()
 
one by one, the list generated from Outlook is compared to every list generated from the registry, by calling _Array_Compare2D()
 
if only a single match is found, then the related profile name is returned to the calling script.
 
the entire process works with Outlook XP and above, also tested on Outlook 2013 64-bit.
 
; #FUNCTION# ====================================================================================================================
; Name ..........: _OL_ProfileGetCurrent
; Description ...: Returns the currently used Outlook profile.
; Syntax.........: _OL_ProfileGetCurrent($oOL)
; Parameters ....: $oOL          - Outlook object returned by a preceding call to _OL_Open()
; Return values .: Success - The currently used Outlook profile.
;                  Failure - Returns "" and sets @error:
;                  |1 - Error connecting to Outlook
;                  |2 - Error generating currently loaded stores list
;                  |3 - Error determining teh registry key where Outlook profiles are stored
;                  |4 - No Outlook profiles are stored in the registry
;                  |5 - No match found
;                  |6 - Multiple matches found
; Author ........: orbs
; Modified ......:
; Remarks .......: the following steps are taken to produce the currently used Outlook profile:
;                  1) a list of mail stores currently loaded to Outlook is genereted
;                  2) a list of Outlook profiles stored in the registry is genereted
;                  3) for every profile stored in the registry, a list of mail stores is produced.
;                  4) the list generated in step (1) is compared to each of the lists generated in step (3)
;                  5) if a single match is found, the profile name is returned
; Related .......: _Array_Compare2D
;                  __OL_ProfileGetRegKey
;                  __OL_PSTGet_StoreID_FromOutlook
;                  __OL_PSTGet_StoreID_FromRegistry
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func _OL_ProfileGetCurrent($oOL)
    ; init
    Local $sResult=''
    Local $nResults=0
    Local $s_OL_RegKeyProfiles=''
    Local $sProfile=''
    Local $nProfiles=0
    Dim $aProfiles[1]=[0]
    ; verify connection to Outlook
    If $oOL=0 Then Return SetError(1,0,'')
    ; get PSTs list from Outlook
    $aPST_Outlook=__OL_PSTGet_StoreID_FromOutlook($oOL)
    If $aPST_Outlook[0][0]=0 Then Return SetError(2,0,'')
    _ArraySort($aPST_Outlook)
    ; get profiles list key in registry
    $s_OL_RegKeyProfiles=__OL_ProfileGetRegKey($oOL)
    If $s_OL_RegKeyProfiles='' Then Return SetError(3,0,'')
    ; get list of profiles from registry
    While True
        $sProfile=RegEnumKey($s_OL_RegKeyProfiles,$nProfiles+1)
        If @error <> 0 Then ExitLoop
        $nProfiles+=1
        ReDim $aProfiles[$nProfiles+1]
        $aProfiles[$nProfiles]=$sProfile
        $aProfiles[0]=$nProfiles
    WEnd
    If $nProfiles=0 Then Return SetError(4,0,'')
    ; for each profile get list of PSTs and compare to PSTs list from Outlook
    For $i=1 To $aProfiles[0]
        $aPST_Reg=__OL_PSTGet_StoreID_FromRegistry($aProfiles[$i],$s_OL_RegKeyProfiles)
        _ArraySort($aPST_Reg)
        $aDiff=_Array_Compare2D($aPST_Outlook,$aPST_Reg)
        If $aDiff[0][0]=0 Then
            $nResults+=1
            $sResult=$aProfiles[$i]
        EndIf
    Next
    ; return
    Switch $nResults
        Case 0  ; no match found
            Return SetError(5,0,'')
        Case 1  ; match
            Return $sResult
        Case Else   ; multiple match
            Return SetError(6,0,'')
    EndSwitch
EndFunc

; #FUNCTION# ====================================================================================================================
; Name ..........: _Array_Compare2D
; Description ...: Compares the first two diemnsions of two input arrays.
; Syntax.........: _Array_Compare2D($a1,$a2)
; Parameters ....: $a1,$a2 - two 2D arrays.
; Return values .: An array of size [n+1][3], where n is the number of differences, and the columns are:
;                  rows 1..n:
;                    cell position (zero-based) | value in $a1 | value in $a2
;                  row 0:
;                    cell [0][0] holds the number of differences, 0 means no differences, -1 means some mismatch between the arrays sizes or dimensions.
;                    cell [0][1] holds the sizes of dimensions of $a1 (only 1st two dimentions)
;                    cell [0][2] holds the sizes of dimensions of $a2 (only 1st two dimentions)
;                  an array is always returned, even when an error occurs - see "Remarks" section hereunder.
; Author ........: orbs
; Modified ......:
; Remarks .......: input variables, 1D arrays, or arrays different in sizes, are handled as described in the "Return values" section above, also see Exmple #2 hereunder
;                  to use this function as boolean indication (arrays are either identical or not), check cell [0][0] of the return array:
;                    arrays are identical only when cell [0][0] holds 0.
;                  Example #1: in case the arrays are of size 8x7 and are identical except of:
;                    $a1[3][1]='ABC' and $a2[3][1]='DEF'
;                    $a1[5][6]='123' and $a2[5][6]='456'
;                  the return array will be:
;                    +---+---+---+
;                    | 2 |8x7|8x7|
;                    +---+---+---+
;                    |3x1|ABC|DEF|
;                    +---+---+---+
;                    |5x6|123|456|
;                    +---+---+---+
;                  Example #2: in case the arrays sizes are different: $a1 size = 3x2 , $a2 size = 1x2
;                  the return array will be:
;                    +---+---+---+
;                    | -1|3x2|1x2|
;                    +---+---+---+
;                  note: 1D array of size 3 will be noted as 3x0, a variable will be noted as an array of size 0x0
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func _Array_Compare2D($a1,$a2)
    ; declare
    Local $a3[1][3] ; will be filled and returned
    Local $n=0      ; the number of differences
    Local $i,$j     ; loop index variables
    ; init
    $a3[0][0]=0
    $a3[0][1]=UBound($a1,1)&'x'&UBound($a1,2)
    $a3[0][2]=UBound($a2,1)&'x'&UBound($a2,2)
    If UBound($a1,0)<>2 Or (Ubound($a1,1)<>Ubound($a2,1)) Or (Ubound($a1,2)<>Ubound($a2,2)) Then
        $a3[0][0] = -1
    Else
        ; compare
        For $i=0 To UBound($a1,1)-1
            For $j=0 To UBound($a1,2)-1
                If $a1[$i][$j]<>$a2[$i][$j] Then
                    $n+=1
                    ReDim $a3[$n+1][3]
                    $a3[0][0]=$n
                    $a3[$n][0]=$i&'x'&$j
                    $a3[$n][1]=$a1[$i][$j]
                    $a3[$n][2]=$a2[$i][$j]
                EndIf
            Next
        Next
    EndIf
    ; return
    Return $a3
EndFunc   ;==>_Array_Compare2D

; #FUNCTION# ====================================================================================================================
; Name ..........: __OL_ProfileGetRegKey
; Description ...: Returns the key where Outlook profiles are stored. different versions of Outlook use different keys.
; Syntax.........: __OL_ProfileGetRegKey($oOL)
; Parameters ....: $oOL          - Outlook object returned by a preceding call to _OL_Open()
; Return values .: Success - The registry key where Outlook profiles are stored
;                  Failure - Returns "" and sets @error:
;                  |1 - Error connecting to Outlook
;                  |2 - Error retrieving Outlook version
; Author ........: orbs
; Modified ......:
; Remarks .......:
; Related .......: _OL_ProfileGetCurrent
;                  __OL_ProfileGetRegKey
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __OL_ProfileGetRegKey($oOL)
    Local $s_OL_RegKeyProfiles=''
    ; verify connection to Outlook
    If $oOL=0 Then SetError(1,0,'')
    ; get Outlook version
    $aVersion=StringSplit($oOL.Version, '.')
    If @error Then SetError(2,0,'')
    ; parse version number for registry key location
    If Int($aVersion[1])>=15 Then   ; Outlook 2013 and later
        $s_OL_RegKeyProfiles='HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles'
    Else    ; Outlook 2010 and earlier
        $s_OL_RegKeyProfiles='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles'
    EndIf
    Return $s_OL_RegKeyProfiles
EndFunc

; #FUNCTION# ====================================================================================================================
; Name ..........: __OL_PSTGet_StoreID_FromOutlook
; Description ...: Returns a list of currently accessed mail stores
; Syntax.........: __OL_PSTGet_StoreID_FromOutlook($oOL)
; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open()
; Return values .: Success - two-dimensional one-based array with the following columns:
;                  |0 - Display name of the mail store
;                  |1 - StoreID of the mail store
;                  Failure - Returns "" and sets @error:
;                  |1 - Error accessing namespace object. For details check @extended
; Author ........: water
; Modified ......: orbs
; Remarks .......: based on function _OL_PSTGet by water
; Related .......: _OL_ProfileGetCurrent
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __OL_PSTGet_StoreID_FromOutlook($oOL)
    Local $sFolderSubString, $sPath, $iIndex1 = 0, $iIndex2, $iPos, $aPST[1][2]
    $aPST[0][0]=0
    Local $oNamespace = $oOL.GetNamespace("MAPI")
    If @error Or Not IsObj($oNamespace) Then Return SetError(1, 0, "")
    For $oFolder In $oNamespace.Folders
        $sPath = ""
        For $iIndex2 = 1 To StringLen($oFolder.StoreID) Step 2
            $sFolderSubString = StringMid($oFolder.StoreID, $iIndex2, 2)
            If $sFolderSubString <> "00" Then $sPath &= Chr(Dec($sFolderSubString))
        Next
        If StringInStr($sPath, "mspst.dll") > 0 Or StringInStr($sPath, "pstprx.dll") > 0 Then
            ReDim $aPST[UBound($aPST, 1) + 1][UBound($aPST, 2)]
            $iIndex1 = $iIndex1 + 1
            $aPST[$iIndex1][0] = $oFolder.Name
            $aPST[$iIndex1][1] = $oFolder.StoreID
            $aPST[0][0] = $iIndex1
        EndIf
    Next
    Return $aPST
EndFunc

; #FUNCTION# ====================================================================================================================
; Name ..........: __OL_PSTGet_StoreID_FromRegistry
; Description ...: Returns a list of currently accessed mail stores
; Syntax.........: __OL_PSTGet_StoreID_FromRegistry($sProfile,$s_OL_RegKeyProfiles [,$bFileNameInsteadOfStoreID = False])
; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open()
;                  $s_OL_RegKeyProfiles - Registry key that holds Outlook profiles, returned by __OL_ProfileGetRegKey
;                  $bFileNameInsteadOfStoreID - if True, then the file name of the mail store is returned instead of the StoreID
; Return values .: Success - two-dimensional one-based array with the following columns:
;                  |0 - Display name of the mail store
;                  |1 - StoreID or full file name of the mail store
;                  Failure - two-dimensional array of size [1][2], where cell[0][0]=0
; Author ........: orbs
; Modified ......:
; Remarks .......:
; Related .......: _OL_ProfileGetCurrent
;                  __OL_ProfileGetRegKey
; Link ..........: http://www.codeproject.com/Articles/273751/How-to-list-your-Outlook-PST-details-file-name-loc
; Example .......:
; ===============================================================================================================================
Func __OL_PSTGet_StoreID_FromRegistry($sProfile,$s_OL_RegKeyProfiles,$bFileNameInsteadOfStoreID=False)
    Local Const $sRegKeyMaster='9207f3e0a3b11019908b08002b2a56c2'
    Local Const $sRegValMasterConfig='01023d0e'
    Local Const $sRegValPST_IsPST='00033009'
    Local Const $sRegValPST_DataKey='01023d00'
    Local Const $sRegValPST_DisplayName='001f3001'
    Local Const $sRegValPST_DisplayNameOld='001e3001'
    Local Const $sRegValPST_FileName='001f6700'
    Local Const $sRegValPST_StoreID='01020fff'
    Local $sRegValPST_ToTake=$sRegValPST_StoreID
    Local $sRegKeyPST=''
    Local $sRegDatPSTs=''
    Local $i=0
    Local $nResult=0
    Dim $aResult[1][2]
    If $s_OL_RegKeyProfiles='' Then Return $aResult
    If $bFileNameInsteadOfStoreID Then $sRegValPST_ToTake=$sRegValPST_FileName
    $sRegDatPSTs=RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyMaster,$sRegValMasterConfig)
    If @error Then Return $aResult
    $sRegDatPSTs=String(Hex($sRegDatPSTs))
    Local $nCount=Ceiling(StringLen($sRegDatPSTs)/32)
    Local $sRegKeyAssumedRedirectsToPST
    For $i=1 To $nCount
        $sRegKeyAssumedRedirectsToPST=StringMid($sRegDatPSTs,1+($i-1)*32,32)
        If StringLeft(String(Hex(RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyAssumedRedirectsToPST,$sRegValPST_IsPST))),2)='20' Then
            $nResult+=1
            ReDim $aResult[$nResult+1][UBound($aResult,2)]
            $aResult[0][0]=$nResult
            $sRegKeyPST=String(Hex(RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyAssumedRedirectsToPST,$sRegValPST_DataKey)))
            $aResult[$nResult][0]=RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyPST,$sRegValPST_DisplayNameOld)
            If $aResult[$nResult][0]='' Then $aResult[$nResult][0]=StringTrimRight(BinaryToString(RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyPST,$sRegValPST_DisplayName),2),1)
            $aResult[$nResult][1]=StringTrimLeft(RegRead($s_OL_RegKeyProfiles&'\'&$sProfile&'\'&$sRegKeyPST,$sRegValPST_ToTake),2)
        EndIf
    Next
    Return $aResult
EndFunc

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

so, in case you were wondering ...

full-featured PST to MSG converter

check it out: http://sourceforge.net/projects/olbreak/files/v2.0/

the download file is "OLBreak.exe", launch it without command-line parameters to get the ReadMe, which is also displayed in the link. it begins like this:

Summary

~~~~~~~~

OLBreak is a PST to MSG converter for Outlook.

it converts Outlook mail store to its elements as MSG files, maintaining folders structure.

Features

~~~~~~~~~

* Duplicates Filtering

* Accumulative or Differential Processing

* Invalid Characters Handling

* Automation-Ready by Command-Line Parameters and Exit Codes

* Detailed Logging

* Exchange Mailbox Support

* Automatically Acknowledge Outlook Security Warnings

* Portable, Open-Source, and Free for any use

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • 3 weeks later...

water, you may want to add these to the UDF:

_OL_ItemConversationGetTopic()

_OL_ItemConversationGetIndex()

the purpose is to build the conversation list of a given email message. currently, if you have the "index" of all messages, you can easily build the list; i'm in the process of checking if the list can be built directly using the index, without the need to read the entire data store. the "topic" is useless in this case, but it's easy to get so i added it anyway.

; #FUNCTION# ====================================================================================================================
; Name ..........: _OL_ItemConversationGetTopic
; Description ...: Returns the Conversation Topic of an item.
; Syntax.........: _OL_ItemConversationGetTopic($oOL, $vItem[, $sStoreID = Default])
; Parameters ....: $oOL      - Outlook object returned by a preceding call to _OL_Open()
;                  $vItem    - EntryID or object of the item
;                  $sStoreID - Optional: StoreID where the EntryID is stored (default = users mailbox)
; Return values .: Success - Returns a string containing the Conversation Topic of the given item.
;                  Failure - Returns an empty string and sets @error:
;                  |1 - No Outlook item specified
;                  |2 - Item could not be found. EntryID might be wrong
;                  |3 - Item has no Conversation Topic
; Author ........: orbs
; Modified.......:
; Remarks .......: based on _OL_ItemAttachmentGet() by water
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_ItemConversationGetTopic($oOL, $vItem, $sStoreID = Default)
    If Not IsObj($vItem) Then
        If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, '')
        $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
        If @error Then Return SetError(2, @error, '')
    EndIf
    Local $sConversationTopic=$vItem.ConversationTopic
    If $sConversationTopic='' Then Return SetError(3, 0, '')
    Return $sConversationTopic
EndFunc   ;==>_OL_ItemConversationGetTopic

; #FUNCTION# ====================================================================================================================
; Name ..........: _OL_ItemConversationGetIndex
; Description ...: Returns the Conversation Index of an item.
; Syntax.........: _OL_ItemConversationGetIndex($oOL, $vItem[, $sStoreID = Default])
; Parameters ....: $oOL      - Outlook object returned by a preceding call to _OL_Open()
;                  $vItem    - EntryID or object of the item
;                  $sStoreID - Optional: StoreID where the EntryID is stored (default = users mailbox)
; Return values .: Success - Returns a string containing the Conversation Index of the given item.
;                  Failure - Returns an empty string and sets @error:
;                  |1 - No Outlook item specified
;                  |2 - Item could not be found. EntryID might be wrong
;                  |3 - Item has no Conversation Index
; Author ........: orbs
; Modified.......:
; Remarks .......: based on _OL_ItemAttachmentGet() by water
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_ItemConversationGetIndex($oOL, $vItem, $sStoreID = Default)
    If Not IsObj($vItem) Then
        If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, '')
        $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
        If @error Then Return SetError(2, @error, '')
    EndIf
    Local $sConversationIndex=$vItem.ConversationIndex
    If $sConversationIndex='' Then Return SetError(3, 0, '')
    Return $sConversationIndex
EndFunc   ;==>_OL_ItemConversationGetIndex

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

orbs,

thanks a lot for this functions!

I will have a look and test them and see how they can be included in the UDF.

Which version of Outlook do you use? I noticed that Outlook 2010 has a new object: Conversation.

So let's see which function can be made available for which Outlook version.

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

generally, i test my functions with Outlook 2003, 2007, 2010, and 2013 64-bit. Outlook XP support is tested, but i don't mind if that fails.

in the future i will comment my functions with the supported Outlook version.

specifically, my goal is to generate the conversation list related to a given email message.

1) the Conversation object has the GetTable method, which - with some extra processing - will achieve the goal.

2) it can be achieved also by using the Conversation Index as is.

i must assess the complexity of coding each option, and the performance of the solution.

my obvious choice would be the latter, as it has wider compatibility. i have already began coding it, it is very easy to code, but requires reading the entire data store (or so it seems), hunting for messages that comply with the index. if the Conversation object works by pre-storing the conversation table - which i doubt - it will be much faster. it requires more study, and i can not handle two research projects at a time. with your blessings, i will complete what i'm doing with the index, then i will tackle the Conversation object method (or someone else can beat me to it).

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

As there are still many users running Outlook 2003 and 2007 I think the UDF should support them.

If we have the choice to make a function runnable with those I then prefer this option.

I will read the MS documentation as well to get an idea how this all works in Outlook 2003/2007.

Thanks a lot for your contribution!

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

orbs,

how about putting it all into a single function: _OL_ConversationGet?

If the Outlook version is < 2010 then return an array with ID and topic. Else return an array with all information derived from the Conversation object. This part doesn't work yet but I'm sure we can create a useful function.

; #FUNCTION# ====================================================================================================================
; Name ..........: _OL_ItemConversationGet
; Description ...: Returns the conversation topic and index of an item.
; Syntax.........: _OL_ItemConversationGet($oOL, $vItem[, $sStoreID = Default])
; Parameters ....: $oOL      - Outlook object returned by a preceding call to _OL_Open()
;                  $vItem    - EntryID or object of the item
;                  $sStoreID - Optional: StoreID where the EntryID is stored (default = users mailbox)
; Return values .: Success - one-dimensional one based array with the following information:
;                  |1 - String representing the index/ID of the conversation thread
;                  |2 - String representing the topic of the conversation thread
;                  Failure - Returns "" and sets @error:
;                  |1 - $oOL is not an object
;                  |2 - No Outlook item specified
;                  |3 - Item could not be found. EntryID might be wrong. @extended is set to the COM error
;                  |4 - Item is not part of a conversation
;                  |5 - Outlook 2010: Store is not conversation enabled
;                  |6 - Conversation object could not be accessed. @extended is set to the COM error
;                  |7 - Table object of conversation could not be accessed. @extended is set to the COM error
; Author ........: orbs
; Modified.......:
; Remarks .......: based on _OL_ItemAttachmentGet() by water
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _OL_ItemConversationGet($oOL, $vItem, $sStoreID = Default)
    If Not IsObj($oOL) Then Return SetError(1, 0, "")
    If Not IsObj($vItem) Then
        If StringStripWS($vItem, 3) = "" Then Return SetError(2, 0, "")
        $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
        If @error Then Return SetError(3, @error, "")
    EndIf
    Local $aVersion = StringSplit($oOL.Version, '.')
    ; Outlook 2007 or older
    If Int($aVersion[1]) < 14 Then
        Local $aConversation[3] = [2]
        $aConversation[1] = $vItem.ConversationIndex
        If $aConversation[1] = "" Then Return SetError(4, 0, "")
        $aConversation[2] = $vItem.ConversationTopic
        Return $aConversation
    EndIf
    ; Outlook 2010
    Local $oStore, $aConversation[3] = [2]
    If $sStoreID <> Default Then
        $oStore = $oOL.Session.GetStoreFromID($sStoreID)
    Else
        $oStore = $vItem.Parent.Store
    EndIf
    If $oStore.IsConversationEnabled = False Then Return SetError(5, 0, "")
    $oConversation = $vItem.GetConversation()
    If @error or Not IsObj($oConversation) Then Return SetError(6, @error, "")
    $aConversation[1] = $oConversation.ConversationID
    Local $oTable = $oConversation.GetTable()
    If @error or Not IsObj($oTable) Then Return SetError(7, @error, "")
    Local $iConversations = $oTable.getRowCount()
    While Not  $oTable.EndOfTable
        $oRow = $oTable.GetNextRow()
        ConsoleWrite($oRow("EntryID") & "-" & $oRow("Subject") & @CRLF) ; <<== I'm stuck here at the moment
    WEnd
    Return $aConversation
EndFunc   ;==>_OL_ItemConversationGet
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

let me focus on something i see in your func, before i can express opinion: what is Store is not conversation enabled ?

 

edit: i'm asking, because MSDN says (for Outlook 2010):

A store supports the Conversation view if the store is a POP, IMAP, or PST store, or if it runs a version of Microsoft Exchange Server that is at least Microsoft Exchange Server 2010. A store also supports the Conversation view if the store is running Microsoft Exchange Server 2007, the version of Outlook is at least Microsoft Outlook 2010, and Outlook is running in cached mode.

If a store supports conversations, calling the GetConversation method of an item in the store returns a Conversation object for the item. If the store does not support conversations, GetConversation returns Nothing (null in C#) for items in the store.

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._store.isconversationenabled(v=office.14).aspx

however, i can read the conversation index for Outlook 2003 successfully.

Edited by orbs

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

I have taken the code from a MSDN example, so it might not be the best way to code it.

Looks like we can combine error code 5 and 6.

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

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