JohnBailey Posted April 9, 2007 Share Posted April 9, 2007 (edited) Does anyone know how to cause the FileSaveDialog window to Activate? I know it's supposed to but when I run it through loops it gets lost in the background every time. Any ideas as to why this happens or how to cause the FileSaveDialog to show up focused, is much appreciated.MODS: My apology. I didn't realize I posted this in the GUI Help and Support area. You are more than welcome to move this thread. I didn't even notice that I was in the wrong one. Edited April 10, 2007 by JohnBailey A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted April 9, 2007 Author Share Posted April 9, 2007 Really I'd like to use a dll instead of the FileSaveDialog function in AUI3. I found this for Vista, but I'm looking for it's equivalent for XPhttp://msdn.microsoft.com/library/default....esavedialog.asp A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted April 10, 2007 Author Share Posted April 10, 2007 Ok, that's way over my head for right now. However, that's exciting. I'll be reading through this and researching. I'll post my results.http://msdn.microsoft.com/library/default....penfilename.asp A decision is a powerful thing Link to comment Share on other sites More sharing options...
socratessa Posted April 10, 2007 Share Posted April 10, 2007 (edited) Does anyone know how to cause the FileSaveDialog window to Activate? I know it's supposed to but when I run it through loops it gets lost in the background every time. Any ideas as to why this happens or how to cause the FileSaveDialog to show up focused, is much appreciated.Maybe you could post youre code to see what you have made until now.That way somebody else could help you with what you have made so far. Edited April 10, 2007 by socratessa Dont cry tomorrow about what you should have done yesterday. Just do it now. Link to comment Share on other sites More sharing options...
JohnBailey Posted April 10, 2007 Author Share Posted April 10, 2007 This is just the original script. I am working to rewrite it using a dll call. The problem with the below is that the FileSaveDialog box gets pushed behind the windows when preforming the script on several selected messages.Note: This requires Outlook to be open and at least one message selected.Hopefully, someone will yell at me and tell me how else I could improve on my crappy script.expandcollapse popup#include <File.au3> #include <Array.au3> #include"./Include/OPrinter.au3" Opt("WinTitleMatchMode", 3) HotKeySet("{ESC}", "Terminate") Func Terminate() Exit EndFunc SetDefault("Adobe PDF") Sleep(2000) $oOutlookApp = ObjCreate("Outlook.Application") $oOutlookExp = $oOutlookApp.ActiveExplorer $oOutlookSel = $oOutlookExp.Selection If NOT IsObj($oOutlookApp) Then MsgBox(0,'',"$oOutlookApp not object") Else For $x = 1 To $oOutlookSel.Count Local $s = FileSaveDialog("Select Location and Give File Name", 'I:\SAI\', "All(*.pdf)",2,"") If @error Then ;<--- If cancel is clicked Exit EndIf Dim $szDrive, $szDir, $szFName, $szExt $TestPath = _PathSplit($s, $szDrive, $szDir, $szFName, $szExt) Local $selectedLocation = $szDrive&$szDir Local $fileName = $szFName&$szExt ;MsgBox(0,'', $oOutlookSel.Item($x).SenderName) ;<---- Message (Mail) From ;ControlSetText('test.txt - Notepad','',"Edit1",$oOutlookSel.Item($x).Body) $oOutlookSel.Item($x).PrintOut Local $window = 'Save PDF File As' WinWaitActive($window) WinSetState($window,'',@SW_HIDE) ControlSetText($window,'',"Edit1",$s) ControlClick($window,'',"Button2") 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 Sleep(2500) For $i = 1 to Ubound($attachmentsArray)-1 $window = 'Adobe Acrobat Professional - ['&$fileName&']' WinActivate($window) Sleep(1000) Send('{altdown}d') Sleep(300) Send('n') Sleep(500) Send('{altup}') ;WinMenuSelectItem($window,'','&Document','I&nset Pages...');<-- doesn't work with Acrobat Sleep(200) $window = 'Select File To Insert' ControlSetText($window,'','Edit1',$attachmentsArray[$i]) Sleep(300) ControlClick($window,'','Button2') Sleep(300) $window = 'Insert Pages' ControlClick($window,'','Button5') Sleep(1000) FileDelete($attachmentsArray[$i]) Next Else MsgBox(0,'','no attachments') Endif Sleep(500) $window = 'Adobe Acrobat Professional - ['&$fileName&']' WinClose($window) Send('{altdown}f') Sleep(300) Send('x') Sleep(500) Send('{altup}') Sleep(500) $window = 'Adobe Acrobat' ControlClick($window,'','Button2') Sleep(1500) $window = 'Adobe Acrobat Professional - ['&$fileName&']' WinClose($window) Sleep(500) $window = 'Adobe Acrobat' ControlClick($window,'','Button2') Next EndIfBack to testing and researching the dll for Dialog boxes A decision is a powerful thing Link to comment Share on other sites More sharing options...
Valuater Posted April 10, 2007 Share Posted April 10, 2007 Autoit Wrappers... is your friendhttp://www.autoitscript.com/forum/index.ph...st&p=1374918) Link to comment Share on other sites More sharing options...
JohnBailey Posted April 10, 2007 Author Share Posted April 10, 2007 For those of you following this thread:http://www.autoitscript.com/forum/index.ph...=35999&st=0read in its entirety A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted April 10, 2007 Author Share Posted April 10, 2007 Valuater, that's wild! I was reading that yesterday and today, but couldn't get anything out of it for my purposes. What you posted is perfect! Thank you very much The link I posted goes about it a different way completely (dll calls). Any recommendations? A decision is a powerful thing Link to comment Share on other sites More sharing options...
Valuater Posted April 10, 2007 Share Posted April 10, 2007 (edited) Valuater, that's wild! I was reading that yesterday and today, but couldn't get anything out of it for my purposes. What you posted is perfect! Thank you very muchThe link I posted goes about it a different way completely (dll calls). Any recommendations?Welcome... Actually, I did not read your script.. but, you could "more easily" incorporate the script i referred to you than to learn all about the Dll and Object possibilities8) Edited April 10, 2007 by Valuater 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