JohnBailey Posted July 16, 2007 Share Posted July 16, 2007 (edited) Mods: can you please move this to the COM threads areaI know how to invoke some commands and then pull info from Outlook, but only if email is selected. How do a force a certain amount of email to be selected. For instance, the first (most recent) 10 emails in the inbox?expandcollapse popupOpt("TrayIconDebug", 1) Opt("WinSearchChildren", 1) TrayTip("AutoIt Script", @ScriptName, 60, 1) HotKeySet("{ESC}", "Terminate") Func Terminate() WinMinimizeAllUndo() Exit EndFunc #include <File.au3> #include <Array.au3> #include <Date.au3> $oOutlookApp = ObjCreate("Outlook.Application") If NOT IsObj($oOutlookApp) Then MsgBox(0,'',"$oOutlookApp not object") Else $oOutlookExp = $oOutlookApp.ActiveExplorer $oOutlookSel = $oOutlookExp.Selection For $x = 1 To 5;$oOutlookSel.Count Local $getSubjectName = $oOutlookSel.Item($x).Subject Local $defaultFileName = StringReplace($getSubjectName,":"," ") Local $selectedLocation = @ScriptDir&'\' ConsoleWrite($oOutlookSel.Item($x).Subject&@CRLF) ;MsgBox(0,'', $oOutlookSel.Item($x).Subject) ;<---- Subject Line ;MsgBox(0,'', $oOutlookSel.Item($x).SenderName) ;<---- Message (Mail) From ;ControlSetText('test.txt - Notepad','',"Edit1",$oOutlookSel.Item($x).Body) If StringInStr($oOutlookSel.Item($x).Subject,'PAI Managed Accts Report') > 0 Then If $oOutlookSel.Item($x).Attachments.Count Then Local $oOutlookAttachments = $oOutlookSel.Item($x).Attachments Local $attachmentsArray = _ArrayCreate("nothing") For $xx = 1 To $oOutlookAttachments.Count $oOutlookAttachments.Item($xx).SaveAsFile($selectedLocation&$oOutlookAttachments.Item($xx).DisplayName) _ArrayAdd($attachmentsArray,$selectedLocation&$oOutlookAttachments.Item($xx).DisplayName) ;MsgBox(0,'',$oOutlookAttachments.Item($xx).DisplayName) ;<---Shows the file name ;MsgBox(0,'',$oOutlookAttachments.Item($xx).FileName) ;<---Shows the file name another method Next Else ;continue to look Endif EndIf Next EndIf MsgBox(0,'Auto Archiver','Completed', 4) Edited July 16, 2007 by JohnBailey A decision is a powerful thing Link to comment Share on other sites More sharing options...
ptrex Posted July 17, 2007 Share Posted July 17, 2007 (edited) @JohnBaileyMaybe this can get you started.Outlook Archiverregards,ptrex Edited July 17, 2007 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
JohnBailey Posted July 17, 2007 Author Share Posted July 17, 2007 Maybe this can get you started.Outlook Archiverthat's really neat! Thank you for dropping that by me! A decision is a powerful thing 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