autoit0822 Posted October 29, 2015 Share Posted October 29, 2015 (edited) I am trying to adapt this script to work in MS Outlook 2010 on Windows 7 x64. To begin with:;//$Path = FileGetShortName(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls", "mlcfg32.cpl")) ;//Run(@SystemDir & "\control.exe " & $Path) Run('%WINDIR%\SysWOW64\control mlcfg32.cpl')Then, at the point the script goes into each listed data file, this window doesn't seem to be accounted for: Edited October 31, 2015 by autoit0822 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 30, 2015 Moderators Share Posted October 30, 2015 @autoit0822 in the future, please pay attention to which forum you post in. The Examples forum clearly states that it is not a place for seeking Help. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jguinch Posted October 30, 2015 Share Posted October 30, 2015 This code works with Outlook 2010 (French version), you will have to change the title of each window :http://www.autoitscript.fr/forum/viewtopic.php?p=95920#p95920 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
autoit0822 Posted October 31, 2015 Author Share Posted October 31, 2015 (edited) @autoit0822 in the future, please pay attention to which forum you post in. The Examples forum clearly states that it is not a place for seeking Help.On reviewing the post from which I started this topic, I see from the bottom of the screen that it is in the Examples forum: perhaps it could have been made more conspicuous what forum I was starting a new topic in?This code works with Outlook 2010 (French version), you will have to change the title of each window :http://www.autoitscript.fr/forum/viewtopic.php?p=95920#p95920Thank you; however, the script does not take account of Exchange (.ost) data files as pictured above. Would you be able, please, to adapt the script to compress Exchange (.ost) data files, and ignore .pst data files? Edited October 31, 2015 by autoit0822 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 31, 2015 Moderators Share Posted October 31, 2015 @autoit0822 It was a friendly request to pay more attention. Please note, it is pretty clearly stated at the top of that particular forum... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
autoit0822 Posted October 31, 2015 Author Share Posted October 31, 2015 @autoit0822 It was a friendly request to pay more attention. Please note, it is pretty clearly stated at the top of that particular forum...This is what I see: Link to comment Share on other sites More sharing options...
autoit0822 Posted November 2, 2015 Author Share Posted November 2, 2015 (edited) This script selects and compacts PST files, but not OST files:;//Source: http://www.autoitscript.fr/forum/viewtopic.php?p=95920#p95920 #include <GUIListView.au3> Opt("WinTitleMatchMode", 4) SplashTextOn("Microsoft Outlook 2010 Data File Compacter", "Compacting data files...", 250, 40) $Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls", "mlcfg32.cpl") Run(@SystemDir & "\control.exe " & $Path) $hMailCfg = WinWait("Mail Setup", "E-mail Accounts") ControlClick("Mail Setup", "E-mail Accounts", "Button2") $hAccountWindow = WinWait("Account Settings", "Data Files") $hlist = ControlGetHandle($hAccountWindow, "", "[CLASS:SysListView32; INSTANCE:2]") If @error Then Exit $arraycount = _GUICtrlListView_GetItemCount($hlist) If Not $arraycount Then Exit MsgBox(16, "", "No data file found.") Local $ltext[$arraycount] For $i = 0 To $arraycount - 1 _GUICtrlListView_ClickItem($hlist, $i, "left", False, 2) $hDataFile = WinWait("Outlook Data File", "Outlook Data File") ControlClick($hDataFile, "", "Button2") $hWait = WinWait("Compact Now") WinWaitClose($hWait) WinClose($hDataFile) Next WinClose($hAccountWindow) WinClose($hMailCfg) SplashOff()If an OST file is selected, this additional window needs to be accounted for:I would like to adapt the script to take account of OST files, and ignore PST files. Edited November 2, 2015 by autoit0822 Link to comment Share on other sites More sharing options...
water Posted November 2, 2015 Share Posted November 2, 2015 Why did you open a new thread? You already have a tread that should cope with OST too. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Developers Jos Posted November 2, 2015 Developers Share Posted November 2, 2015 Merged... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jguinch Posted November 2, 2015 Share Posted November 2, 2015 The following code works for me, with an Exchange mailbox (French configuration) :expandcollapse popup#include <GUIListView.au3> #include <GuiTab.au3> Opt("WinTitleMatchMode", 4) SplashTextOn("Compacting now", "This may take hours...", 250, 40) $Path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls", "mlcfg32.cpl") Run(@SystemDir & "\control.exe " & $Path) $hMailCfg = WinWait("Configuration de la messagerie", "Comptes de messagerie") ControlClick("Configuration de la messagerie", "Comptes de messagerie", "Button2") $hAccountWindow = WinWait("Paramètres du compte", "Fichiers de données") $hlist = ControlGetHandle($hAccountWindow, "", "[CLASS:SysListView32; INSTANCE:2]") If @error Then Exit $arraycount = _GUICtrlListView_GetItemCount($hlist) If Not $arraycount Then Exit MsgBox(16, "", "Aucun fichier de données trouvé") Local $ltext[$arraycount] For $i = 0 To $arraycount - 1 _GUICtrlListView_ClickItem($hlist, $i, "left", False, 2) $hExchange = WinWait("Microsoft Exchange", "") $hTab = ControlGetHandle($hExchange, "", "[CLASS:SysTabControl32; INSTANCE:1]") _GUICtrlTab_ClickTab($hTab, 1) $hParameters = ControlGetHandle($hExchange, "", "[TEXT:Paramètres du &fichier de données Outlook...]") If ControlCommand($hExchange, "", $hParameters, "IsEnabled") Then ControlClick($hExchange, "", $hParameters) $hDataFile = WinWait("Paramètres du fichier de données Outlook") ControlClick($hDataFile, "", "[CLASS:Button; INSTANCE:2]") $hWait = WinWait("Compresser") WinWaitClose($hWait) WinClose($hDataFile) EndIf WinClose($hExchange) Next WinClose($hAccountWindow) WinClose($hMailCfg) SplashOff() Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
autoit0822 Posted November 3, 2015 Author Share Posted November 3, 2015 (edited) Thank you! A couple of points, though:When the script finds a PST file (window title "Outlook Data File"), that window remains open and the script stalls.$hParameters = ControlGetHandle($hExchange, "", "[TEXT:Outlook Data &File Settings...]")Why is the requisite ampersand placed before "File" when an access key is not designated in the button? Edited November 3, 2015 by autoit0822 Link to comment Share on other sites More sharing options...
autoit0822 Posted November 5, 2015 Author Share Posted November 5, 2015 When the script finds a PST file (window title "Outlook Data File"), that window remains open and the script stalls.If _GUICtrlListView_ClickItem finds a PST file (window title "Outlook Data File"), how can I close that window and continue? 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