ejk66 Posted November 25, 2014 Share Posted November 25, 2014 Hello. New here. I am trying to automate a daily task to print a schedule from a Windows Application called “Calendar Printing Assistant” The task can’t be run from outlook due to some overlay limitations in Outlook itself. I’ve gotten the Application to load, become the active window, select the appropriate calendars and templates. I am at a stop at printing and have explored three options and need advice on the best option and how to proceed. It appears I cannot use WinMenuSelect as it is a toolbar. Option One. My first option is to send the print shortcut command and I have done that successfully using Send("^p"). The problem is a second window comes up that allows you to change print options or just hit a “Print” button and print but here I can’t seem to find what to do (to simply select Print). I tried AutoIt’s macrorecorder, but the only thing that gets recorded is the actual window –with the following: _WinWaitActivate("Print","") When I use AutoIts window info, this is what I get with the Print Dialog: >>>> Window <<<< Title: Print Class: HwndWrapper[CPAO.EXE;;613004ef-abbf-4d04-a92a-74c17cf08f7d] Position: 508, 172 Size: 350, 385 Style: 0x16C80000 ExStyle: 0x00000100 Handle: 0x001806EE >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 625, 249 Cursor ID: 0 Color: 0x55B5E6 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Option Two is to export the file to XPS and then print the XPS file. To export as XPS, I have to access the toolbar. I am unsure of how to do this, but if it were a WinMenuSelect item, the equivalent thing I would try and do is this: WinMenuSelectItem("[TITLE: Calendar3.calx - Calendar Printing Assistant for Microsoft Office Outlook 2007]", "", "&File", "Pu&blish As XPS...") But as it is a toolbar I can’t do that. Here are the toolbar info: >>>> Window <<<< Title: Calendar3.calx - Calendar Printing Assistant for Microsoft Office Outlook 2007 Class: Framework::CFrame Position: 145, 0 Size: 1044, 788 Style: 0x16CF0000 ExStyle: 0x00000100 Handle: 0x00080C58 >>>> Control <<<< Class: MsoCommandBar Instance: 3 ClassnameNN: MsoCommandBar3 Name: Advanced (Class): [CLASS:MsoCommandBar; INSTANCE:3] ID: Text: Menu Bar Position: 0, 0 Size: 1028, 25 ControlClick Coords: 162, 18 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x001C00F4 >>>> Mouse <<<< Position: 315, 48 Cursor ID: 0 Color: 0xBFDBFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< MsoDockLeft Calendar Bar Calendar Bar MsoDockTop Standard Menu Bar >>>> Hidden Text <<<< MsoDockRight MsoDockBottom MsoWorkPane Any thoughts on what I can do? I am good with working with either option or a third option, whatever is the easiest, cleanest and most reliable. I am not a programmer, but did look briefly at a COM option, but I don’t see a COM reference for this application and not sure if that would actually be any easier for me. Thanks in advance for any thoughts. Link to comment Share on other sites More sharing options...
llewxam Posted November 25, 2014 Share Posted November 25, 2014 Sorry if I'm wrong or if you have already tried this, but can't you just send Enter to have it print? Since it is automated, I assume that a less-than-technically-perfect solution would work fine: Send("^p") Sleep(3000) Send("{ENTER}") The sleep is what is not so technical - don't bother trying to find out what the print window is called, just wait for it and send an Enter. Should do fine, I've done something like this in the past as well. Ian My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
ejk66 Posted November 25, 2014 Author Share Posted November 25, 2014 Ian, Occams Razor! The simplest solution! Thanks so much. 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