Jump to content

Outlook Import/Export wizard automation


 Share

Recommended Posts

Hi,

Is it possible to automate the following in outlook :

1) Create a new contacts folder e.g 'GAL'

2) Import a contacts pst from Import/Export wizard and import it into the 'GAL'

3) In Address Book Options, change the address list order to make it goto the top, also set the 'GAL' to show as the first list

Thanks

Link to comment
Share on other sites

If you use Outlook 2007 or later you can try my OutlooKEX UDF.

1) Yes

2) Yes

3) Not at the moment. But shouldn't be that hard

Just a quick and short reply. If you need more information - just post.

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

If you use Outlook 2007 or later you can try my OutlooKEX UDF.

1) Yes

2) Yes

3) Not at the moment. But shouldn't be that hard

Just a quick and short reply. If you need more information - just post.

Thanks for your reply.

So how would this be done ? Is it through pure scripting or by simulating keyboard and mouse ?

Link to comment
Share on other sites

It's pure scripting. The OutlookEX UDF access Outlook using COM.

You would do something like:

_OL_Open()            ; Open connection to Outlook
_OL_FolderCreate()    ; Create the new folder
_OL_FolderAccess()    ; Access your PST
_OL_ItemCopy          ; Copy the required items in a loop
_OL_Close()           ; Close the Outlook connection
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

It's pure scripting. The OutlookEX UDF access Outlook using COM.

You would do something like:

_OL_Open()            ; Open connection to Outlook
_OL_FolderCreate()  ; Create the new folder
_OL_FolderAccess()  ; Access your PST
_OL_ItemCopy          ; Copy the required items in a loop
_OL_Close()           ; Close the Outlook connection

Thanks. So regarding the third part, can you please terll me how can that be achieved ? When you said 'Not at the moment' I presume your OutlooKEX UDF doesnt have the funtion for it. So would that be done via recording keystrokes and mouse movements or can that be scripted too.
Link to comment
Share on other sites

Regarding part 3:

This will be a bit harder because "The ResolutionOrder property is read-only. You cannot change the resolution order of an address list through the Outlook object model." according to MSDN (this seems to be true for Outlook 2007 and 2010).

So another solution needs to be found (Registry, GUI automation ...). Need to think about that.

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

Regarding part 3:

This will be a bit harder because "The ResolutionOrder property is read-only. You cannot change the resolution order of an address list through the Outlook object model." according to MSDN (this seems to be true for Outlook 2007 and 2010).

So another solution needs to be found (Registry, GUI automation ...). Need to think about that.

Thank you very much for your help. If you get the time and you are able to figure this out it would really be great.

Link to comment
Share on other sites

Why do you want to change the order of address resolution?

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 think we should start with 1) and 2). Do you need any assistance?

_OL_Open()            ; Open connection to Outlook
_OL_FolderCreate()    ; Create the new folder
_OL_FolderAccess()    ; Access your PST
_OL_ItemCopy          ; Copy the required items in a loop
_OL_Close()           ; Close the Outlook connection
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

At the moment we wanted to see if this tool could achieve what we are trying to do. Also we have to get this tool authorised for use, only then we shall be able to use and test it. So if and when we do it I shall ask for your help. I really appreciate your help

I think we should start with 1) and 2). Do you need any assistance?

_OL_Open()            ; Open connection to Outlook
_OL_FolderCreate()  ; Create the new folder
_OL_FolderAccess()  ; Access your PST
_OL_ItemCopy          ; Copy the required items in a loop
_OL_Close()           ; Close the Outlook connection

Link to comment
Share on other sites

Glad to be of service. If you need a quick and dirty test script just let me know.

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

  • 1 month later...

Just wondered if that offer of a quick and dirty demo script was still open?

I need to export a .pst inbox to a .csv file so that information can be extracted and used in a different program.

I would be very grateful

Link to comment
Share on other sites

I'm not in my office at the moment so I can't test. But a script should like this:

#include <outlookEX.au3>
Global $oOutlook = _OL_Open()
; Access PST
$oFolder = _OL_PSTAccess($oOutlook, "C:tempTest.pst")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX Example Script", "Error accessing 'C:tempTest.pst' archive. @error = " & @error & ", @extended: " & @extended)
; Find mail items in the folder and all subfolders
$aItems = _OL_ItemFind($oOutlook, $oFolder, $olMail, "", "", "", "<List the fields you want to retrieve here>", "", 1)
If Not IsArray($aItems) Then Exit MsgBox(48, "OutlookEX Example Script", "Error searching mail items. @error = " & @error & ", @extended: " & @extended)
; Write records to export file
$iResult = _OL_ItemExport("C:tempTest.csv", "", "", 1, "<List the fields you have retrieved here as header line>", $aItems)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX Example Script", "Error exporting data to file 'C:tempTest.csv'. @error = " & @error & ", @extended = " & @extended)
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

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