Klexen Posted September 18, 2009 Share Posted September 18, 2009 (edited) I wrote this so we could have users at work run it and automatically compress their PST's. Depending on the size, it could take several hours! expandcollapse popup#include <GUIListView.au3> ;~ BlockInput(1) SplashTextOn("Compacting now", "This may take hours...", 250, 40) ;//Runs the mail application that is in control panel. $Path = FileGetShortName(@CommonFilesDir & "\System\MSMAPI\1033\MLCFG32.CPL") Run(@SystemDir & "\control.exe " & $Path) WinWait("Mail Setup", "", 3) ControlClick("Mail Setup", "", 1109, "left", 1) ; Click data files WinWait("Outlook Data Files", "", 3) ;//Gets list of data files listed $sTitle = "Outlook Data Files" $hWnd = WinGetHandle($sTitle) If @error Then Exit WinActivate($hWnd) $hlist = ControlGetHandle($hWnd, "", "SysListView321") If @error Then Exit $arraycount = _GUICtrlListView_GetItemCount($hlist) Local $ltext[$arraycount] $i = 0 Do $ltext[$i] = _GUICtrlListView_GetItemText($hlist, $i) $i = $i + 1 Until $i = $arraycount ;//Goes into each listed Data file and compresses them $b = 0 Do _GUICtrlListView_ClickItem($hlist, $b, "left", False, 2) Sleep(1000) ControlClick("Personal Folders", "", "[CLASS:Button; INSTANCE:2]") ; click Compact Now Sleep(1200) If WinExists("Compact Now") Then WinWaitClose("Compact Now") WinClose("Personal Folders") $b = $b + 1 Until $b = $arraycount WinClose("Outlook Data Files") WinClose("Mail Setup") ;~ BlockInput(0) Edited September 18, 2009 by Klexen Link to comment Share on other sites More sharing options...
storme Posted September 23, 2009 Share Posted September 23, 2009 I wrote this so we could have users at work run it and automatically compress their PST's. Depending on the size, it could take several hours! Haven't tried it yet but THANKS. I've got several BIG PST file for the various groups I subscribe to and it's such a bore compressing them all. The only other thing that would be usefull is an automatic recyling bin emptier. I only found out a little while ago (Logical now I know) that each PST has it's own Recyling bin and has to be empied indiviually..sighNow I can just run this and check it out next day. Keep up the good workJohn Morrison akaStorme Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E Link to comment Share on other sites More sharing options...
jolleyaida Posted December 23, 2014 Share Posted December 23, 2014 Auto compression of PST file is possible only if you use third party tools. By using third party tools you will get various options to compress PST file and moreover third party tool provides user option to separate attachments from PST file and save then in a different file folder. Link to comment Share on other sites More sharing options...
water Posted December 23, 2014 Share Posted December 23, 2014 Welcome to AutoIt and the forum! Did you notice that this post mor than 4 years old? Please do not necro old posts 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 More sharing options...
water Posted September 12, 2016 Share Posted September 12, 2016 Advertising commercial products isn't allowed here. rcmaehl 1 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now