Print Page | Close Window

"send to printer" macro

Printed From: MSSpeech-Forum
Category: Windows™ Speech Recognition Forums
Forum Name: Macros and Macro Development
Forum Description: WSR Macros, Tools, Files, and new Macro requests
URL: https://www.msspeech-forum.com/forum_posts.asp?TID=288
Printed Date: 06/Nov/2024 at 2:34pm
Software Version: Web Wiz Forums 12.02 - http://www.webwizforums.com


Topic: "send to printer" macro
Posted By: alassiel
Subject: "send to printer" macro
Date Posted: 30/Apr/2012 at 9:46am
Greetings,

I tried using the Macro Builder in the toolkit to create a macro that sends Ctrl+P to the foreground application.  The toolkit seems to build the macro just fine; I get all of the expected popup windows indicating that the macro has been built.  However, when I actually try to use the macro, I get unexpected results.  For example, when I speak the macro name in Word or Excel, they each open the Font dialogue window.  When I try it in my calendar software (Franklin Covey PlanPlus), the application crashes.  Obviously, if I use the keyboard to press Ctrl+P, all three applications open up the Print dialog box.  Anyone have any ideas what I need to do to get this to work?  I've built other key press macros and they're working as expected.  Thanks in advance for any feedback.

Here's how I completed the macro builder window after which I clicked the build button:






Replies:
Posted By: mmarkoe_admin
Date Posted: 30/Apr/2012 at 11:17am

It sounds as if the problem is Global Command. It seems as if a Global Command should work, but apparently does not. Simply specify each program in the field labeled:
"If program in foreground"

For example, Browse to the Word executable. On the computer workstation I am currently using it is at:

C:\Program Files\Microsoft Office\Office12\WINWORD.EXE

Then name the command something like, "Print to Word"

After adding Ctrl + P to the Action List, add a Pause with the Command Key "Enter" in order to execute the OK in the Print Dialog Box.



Posted By: alassiel
Date Posted: 30/Apr/2012 at 2:20pm
Thanks for your quick response.  I followed your suggestion and created two macros, "Print document" and " Print spreadsheet", each pointing to their specific application, namely Word and Excel.  For now I kept the macros simple, just a Ctrl+P sequence.  Unfortunately, the results were the same as when I created a single global command : (.  Both macros still continued to open the Font dialogue box.  I opened the WSR macro editor so that I could see the xml for the macro created using the Macro Builder in WSR toolkit.  I pasted the relevant lines for the "Print spreadsheet" macro below.  Also included the screen shot from the Toolkit Macro Builder.  Any other ideas?  Am I doing something wrong?  Thanks.

<!-- Command macro created with WSRToolkit (Version: 2.0.4.0) 4/30/2012 1:38:26 PM -->
<speechMacros>
<command>
<appIsInForeground processName ="Excel.exe"/>
<listenFor>Print spreadsheet</listenFor>
<sendKeys>{{CTRL}}P</sendKeys>
</command>





Posted By: mmarkoe_admin
Date Posted: 30/Apr/2012 at 2:57pm
Originally posted by alassiel alassiel wrote:

I followed your suggestion and created two macros, "Print document" and " Print spreadsheet", each pointing to their specific application, namely Word and Excel.
 
The 2 macros Print to Word and Print to Excel are below. These work perfectly in Office 2007. They should work fine in Office 2010 as well. Try these. They were created with the Macro Builder in WSRToolkit version 2.
 
Marty Markoe, eMicrophones, Inc.
 
<!-- Command macro created with WSRToolkit (Version: 2.0.4.0) 4/30/2012 2:47:01 PM -->
<speechMacros>
<command>
<appIsInForeground processName ="Winword.exe"/>
<listenFor>Print to Word</listenFor>
<sendKeys>{{CTRL}}p</sendKeys>
<sendKeys>{ENTER}</sendKeys>
</command>
<Signature>
 
 
<!-- Command macro created with WSRToolkit (Version: 2.0.4.0) 4/30/2012 2:48:39 PM -->
<speechMacros>
<command>
<appIsInForeground processName ="Excel.exe"/>
<listenFor>Print to Excel</listenFor>
<sendKeys>{{CTRL}}p</sendKeys>
<sendKeys>{ENTER}</sendKeys>
</command>
<Signature>


Posted By: alassiel
Date Posted: 30/Apr/2012 at 4:39pm
This is the message I got when I clicked on the links. Help, please :).


Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.




Posted By: alassiel
Date Posted: 02/May/2012 at 8:54am
Hi Marty,

Thanks for showing me the xml for the macros that you created.  I carefully compared one to the macros that I had created and found the important difference.  The key sequence to send something to the printer is Ctrl plus a  lowercase "p", not an upper case "P".  When building the macro in Toolkit, I reflexively entered an upper case "P" because you always see it written as Ctrl+P and I neglected to consider that behind the scenes this translated to Ctrl+Shift+P.  Well, I discovered that in Word and Excel, the key sequence Ctrl+Shift+P opens the Font dialog box.  I recreated my macro, "Send to printer", as a global command using a lowercase "p"; it works perfectly from all three applications (Word, Excel, calendar).

Thanks for your help :).


Posted By: mmarkoe_admin
Date Posted: 02/May/2012 at 10:03am
Originally posted by alassiel alassiel wrote:

I recreated my macro, "Send to printer", as a global command using a lowercase "p"; it works perfectly from all three applications (Word, Excel, calendar).
Good to know. Thank you.
 
Marty



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.02 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net