autoit0822 Posted October 29, 2015 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
Moderators JLogan3o13 Posted October 30, 2015 Moderators 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!
jguinch Posted October 30, 2015 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
autoit0822 Posted October 31, 2015 Author 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
Moderators JLogan3o13 Posted October 31, 2015 Moderators 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!
autoit0822 Posted October 31, 2015 Author 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:
autoit0822 Posted November 2, 2015 Author 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
water Posted November 2, 2015 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 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
Developers Jos Posted November 2, 2015 Developers 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.
jguinch Posted November 2, 2015 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
autoit0822 Posted November 3, 2015 Author 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
autoit0822 Posted November 5, 2015 Author 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?
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