MSSpeech-Forum Homepage
Forum Home Forum Home > Windows™ Speech Recognition Forums > Macros and Macro Development
  New Posts New Posts RSS Feed - "send to printer" macro
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

"send to printer" macro

 Post Reply Post Reply
Author
Message
alassiel View Drop Down
Member
Member


Joined: 26/Sep/2011
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote alassiel Quote  Post ReplyReply Direct Link To This Post Topic: "send to printer" macro
    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:



Back to Top
mmarkoe_admin View Drop Down
Admin Group
Admin Group
Avatar

Joined: 16/Jul/2008
Status: Offline
Points: 331
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmarkoe_admin Quote  Post ReplyReply Direct Link To This Post 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.



Edited by mmarkoe_admin - 30/Apr/2012 at 11:18am
Back to Top
alassiel View Drop Down
Member
Member


Joined: 26/Sep/2011
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote alassiel Quote  Post ReplyReply Direct Link To This Post 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>



Back to Top
mmarkoe_admin View Drop Down
Admin Group
Admin Group
Avatar

Joined: 16/Jul/2008
Status: Offline
Points: 331
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmarkoe_admin Quote  Post ReplyReply Direct Link To This Post 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>


Edited by mmarkoe_admin - 30/Apr/2012 at 4:47pm
Back to Top
alassiel View Drop Down
Member
Member


Joined: 26/Sep/2011
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote alassiel Quote  Post ReplyReply Direct Link To This Post 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.


Back to Top
alassiel View Drop Down
Member
Member


Joined: 26/Sep/2011
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote alassiel Quote  Post ReplyReply Direct Link To This Post 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 :).
Back to Top
mmarkoe_admin View Drop Down
Admin Group
Admin Group
Avatar

Joined: 16/Jul/2008
Status: Offline
Points: 331
Post Options Post Options   Thanks (0) Thanks(0)   Quote mmarkoe_admin Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.02
Copyright ©2001-2019 Web Wiz Ltd.

This page was generated in 0.328 seconds.

Microsoft Most Valuable Professional

§- Thank you for visiting our Windows Speech Recognition and Macro Forum.. -§