Intercept "Print" Word 2010

Follow
Email
While I can't say that I am thrilled by the steps taken to get here, I think 
I have figured out a way to at least simulate intercepting Word's "Print" 
command in Word 2010.

I have a couple of Word 2003 and Word 2007 templates where in the interest 
of being "Green," I have inserted code in templates that intercepted a users 
attempt to print the documents if the left or right margin was greater than 
1 inch.

This process was pretty straight forward in Word 2003 where I simply used 
macros named "FilePrint" and "FileDefaultPrint" to intercept the user 
actions and test for proper margins.

In Word2007, I repurposed the "FilePrint" and "FileQuickPrint" ribbon 
controls and used a VBA callback to test for proper margins.

Concern started to rise when I saw a message from Jay Freeman a few monts 
ago concerning the new interface in Word 2010:

"The FilePrint command, built-in or macro, seems to be obsolete. I haven't 
found any way to intercept the Print button in the Print and
Preview screen. Although using the Ctrl+Alt+NumPadPlus shortcut (the 
ToolsCustomizeKeyboardShortcut command) appears to show the Print
button calling the FilePrint command, a macro named FilePrint won't 
intercept the button click."

I installed Word2010 a week or so ago and have confirmed Jay's observations. 
Like Jay, I was also unable to find a way to intercept the Print button that 
is located on the File>Print Tab.

From what I have been able to determine so far, this "Print" button is a 
built-in control that is part a "GroupPrintSetting" built-in group, that is 
part of a "PrintTab" built-in tab, that is part of the new Backstage UI.

I still have a lot to learn about all these new things, but what I have 
learned so far is very disappointing.

First, it appears that none of the built-in controls of the Backstage UI can 
be repurposed.  This is FAQ published by Microsoft::

"Can I repurpose one of the existing definitive command buttons, fast 
command buttons, or tabs by changing its onAction callback attribute? For 
example can I change the file Save button so that is has an additional type, 
or displays only one file type?

It is not possible to override these commands from the custom UI XML markup 
or by using the object model. Using the DocumentBeforeSave event is one 
alternative, but using that doesn't really change the functionality of the 
individual commands that show up in the Change File Type gallery in the 
Backstage. A better solution would be to consider hiding the built-in UI and 
rebuilding it fully with custom commands."

Secondly, unlike built-in ribbon controls, it doesn't appear that you can 
add built-in Backstage controls to new custom tabs or groups.

Next, again unlike built-in ribbon controls, the backstage controls don't 
appear to be dynamic i.e., you can't set attributes like "getVisible" using 
VBA callbacks.

Like the FAQ suggests, about all you can do is hide the built in controls 
and then attempt to cobble together custom controls to meet your needs.

This is what I did here.

1.  I wrote a XML script that:

     a.   repurposes the "FilePrintQuick" control that you can still add to 
the ribbon or QAT.
     b.  hides the backstage "PrintTab" "GroupPrintSettings" control
     c.  Added a new "PRINT" and "QUICK PRINT" custom control to the "Print 
Tab"

<?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="FilePrintQuick" onAction="BackStage.RepurposedQuickPrint"/>
</commands>
<backstage>
<tab idMso="TabPrint" >
<firstColumn >
<group idMso="GroupPrintSettings" visible="false" />
<group id="customPrinter" label="Print" insertAfterMso="GroupPrintSettings" 
 >
<primaryItem>
<button id="custPrint" label="PRINT" imageMso="PrintAreaMenu" 
isDefinitive="true" onAction="BackStage.OnAction" screentip="Select a 
printer, number of copies, and other printer options before printing." />
</primaryItem>
</group>
<group id="customQuikPrinter" label="Quick Print">
<primaryItem>
<button id="custQuickPrint" label="QUICK PRINT" imageMso="FilePrintQuick" 
isDefinitive="true" onAction="BackStage.OnAction" screentip="Send the 
document directly to the default printer without making changes." />
</primaryItem>
</group>
</firstColumn>
</tab>
</backstage>
</customUI>

In the template, I added a module "Backstage" containing the following VBA 
callbacks:

Option Explicit
Sub OnAction(control As IRibbonControl)
Select Case True
  Case ActiveDocument.PageSetup.RightMargin > 72
    MsgBox "Set green document margins and try again."
  Case ActiveDocument.PageSetup.LeftMargin > 72
    MsgBox "Set green document margins and try again."
  Case Else
    Select Case control.ID
      Case "custPrint"
         Application.Dialogs(wdDialogFilePrint).Show
      Case "custQuickPrint"
         CommandBars.ExecuteMso ("FilePrintQuick")
     End Select
End Select
End Sub

Private Sub RepurposedQuickPrint(ByVal control As IRibbonControl, ByRef 
cancelDefault)
cancelDefault = True
Select Case True
  Case ActiveDocument.PageSetup.RightMargin > 72
    MsgBox "Set green document margins and try again."
  Case ActiveDocument.PageSetup.LeftMargin > 72
    MsgBox "Set green document margins and try again."
  Case Else
    cancelDefault = False
End Select
End Sub

I realize this process seems and is clunky.  I would certainly be nice if it 
were possilbe to simple hide the "PRINT" button on the "PrintGroupSettings" 
controls and add a custom button in its place, but unless I am missing 
something that isn't possible.

Open to any comments or suggestions for improving this process.


-- 
Greg Maxey

See my web site http://gregmaxey.mvps.org
for an eclectic collection of Word Tips.

Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)



0
Reply Greg 4/30/2010 11:43:09 PM
word.vba.general 1023 articles. 0 followers. Follow

3 Replies
1899 Views

Similar Articles

[PageSpeed] 12
Greg

They dynamic feature was removed a while ago.

Janine

"Greg Maxey" <gmaxey@mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in message 
news:OdXic7L6KHA.4940@TK2MSFTNGP05.phx.gbl...
> While I can't say that I am thrilled by the steps taken to get here, I 
> think I have figured out a way to at least simulate intercepting Word's 
> "Print" command in Word 2010.
>
> I have a couple of Word 2003 and Word 2007 templates where in the interest 
> of being "Green," I have inserted code in templates that intercepted a 
> users attempt to print the documents if the left or right margin was 
> greater than 1 inch.
>
> This process was pretty straight forward in Word 2003 where I simply used 
> macros named "FilePrint" and "FileDefaultPrint" to intercept the user 
> actions and test for proper margins.
>
> In Word2007, I repurposed the "FilePrint" and "FileQuickPrint" ribbon 
> controls and used a VBA callback to test for proper margins.
>
> Concern started to rise when I saw a message from Jay Freeman a few monts 
> ago concerning the new interface in Word 2010:
>
> "The FilePrint command, built-in or macro, seems to be obsolete. I haven't 
> found any way to intercept the Print button in the Print and
> Preview screen. Although using the Ctrl+Alt+NumPadPlus shortcut (the 
> ToolsCustomizeKeyboardShortcut command) appears to show the Print
> button calling the FilePrint command, a macro named FilePrint won't 
> intercept the button click."
>
> I installed Word2010 a week or so ago and have confirmed Jay's 
> observations. Like Jay, I was also unable to find a way to intercept the 
> Print button that is located on the File>Print Tab.
>
> From what I have been able to determine so far, this "Print" button is a 
> built-in control that is part a "GroupPrintSetting" built-in group, that 
> is part of a "PrintTab" built-in tab, that is part of the new Backstage 
> UI.
>
> I still have a lot to learn about all these new things, but what I have 
> learned so far is very disappointing.
>
> First, it appears that none of the built-in controls of the Backstage UI 
> can be repurposed.  This is FAQ published by Microsoft::
>
> "Can I repurpose one of the existing definitive command buttons, fast 
> command buttons, or tabs by changing its onAction callback attribute? For 
> example can I change the file Save button so that is has an additional 
> type, or displays only one file type?
>
> It is not possible to override these commands from the custom UI XML 
> markup or by using the object model. Using the DocumentBeforeSave event is 
> one alternative, but using that doesn't really change the functionality of 
> the individual commands that show up in the Change File Type gallery in 
> the Backstage. A better solution would be to consider hiding the built-in 
> UI and rebuilding it fully with custom commands."
>
> Secondly, unlike built-in ribbon controls, it doesn't appear that you can 
> add built-in Backstage controls to new custom tabs or groups.
>
> Next, again unlike built-in ribbon controls, the backstage controls don't 
> appear to be dynamic i.e., you can't set attributes like "getVisible" 
> using VBA callbacks.
>
> Like the FAQ suggests, about all you can do is hide the built in controls 
> and then attempt to cobble together custom controls to meet your needs.
>
> This is what I did here.
>
> 1.  I wrote a XML script that:
>
>     a.   repurposes the "FilePrintQuick" control that you can still add to 
> the ribbon or QAT.
>     b.  hides the backstage "PrintTab" "GroupPrintSettings" control
>     c.  Added a new "PRINT" and "QUICK PRINT" custom control to the "Print 
> Tab"
>
> <?xml version="1.0" encoding="utf-8" ?>
> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
> <commands>
> <command idMso="FilePrintQuick" 
> onAction="BackStage.RepurposedQuickPrint"/>
> </commands>
> <backstage>
> <tab idMso="TabPrint" >
> <firstColumn >
> <group idMso="GroupPrintSettings" visible="false" />
> <group id="customPrinter" label="Print" 
> insertAfterMso="GroupPrintSettings"
> >
> <primaryItem>
> <button id="custPrint" label="PRINT" imageMso="PrintAreaMenu" 
> isDefinitive="true" onAction="BackStage.OnAction" screentip="Select a 
> printer, number of copies, and other printer options before printing." />
> </primaryItem>
> </group>
> <group id="customQuikPrinter" label="Quick Print">
> <primaryItem>
> <button id="custQuickPrint" label="QUICK PRINT" imageMso="FilePrintQuick" 
> isDefinitive="true" onAction="BackStage.OnAction" screentip="Send the 
> document directly to the default printer without making changes." />
> </primaryItem>
> </group>
> </firstColumn>
> </tab>
> </backstage>
> </customUI>
>
> In the template, I added a module "Backstage" containing the following VBA 
> callbacks:
>
> Option Explicit
> Sub OnAction(control As IRibbonControl)
> Select Case True
>  Case ActiveDocument.PageSetup.RightMargin > 72
>    MsgBox "Set green document margins and try again."
>  Case ActiveDocument.PageSetup.LeftMargin > 72
>    MsgBox "Set green document margins and try again."
>  Case Else
>    Select Case control.ID
>      Case "custPrint"
>         Application.Dialogs(wdDialogFilePrint).Show
>      Case "custQuickPrint"
>         CommandBars.ExecuteMso ("FilePrintQuick")
>     End Select
> End Select
> End Sub
>
> Private Sub RepurposedQuickPrint(ByVal control As IRibbonControl, ByRef 
> cancelDefault)
> cancelDefault = True
> Select Case True
>  Case ActiveDocument.PageSetup.RightMargin > 72
>    MsgBox "Set green document margins and try again."
>  Case ActiveDocument.PageSetup.LeftMargin > 72
>    MsgBox "Set green document margins and try again."
>  Case Else
>    cancelDefault = False
> End Select
> End Sub
>
> I realize this process seems and is clunky.  I would certainly be nice if 
> it were possilbe to simple hide the "PRINT" button on the 
> "PrintGroupSettings" controls and add a custom button in its place, but 
> unless I am missing something that isn't possible.
>
> Open to any comments or suggestions for improving this process.
>
>
> -- 
> Greg Maxey
>
> See my web site http://gregmaxey.mvps.org
> for an eclectic collection of Word Tips.
>
> Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)
>
>
> 
0
Reply Janine 5/1/2010 2:01:49 AM
Removing features that worked and that improved UI flexibility seems to be 
step backwards.  Do you think that is where MS is headed?

Janine wrote:
> Greg
>
> They dynamic feature was removed a while ago.
>
> Janine
>
> "Greg Maxey" <gmaxey@mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in
> message news:OdXic7L6KHA.4940@TK2MSFTNGP05.phx.gbl...
>> While I can't say that I am thrilled by the steps taken to get here,
>> I think I have figured out a way to at least simulate intercepting
>> Word's "Print" command in Word 2010.
>>
>> I have a couple of Word 2003 and Word 2007 templates where in the
>> interest of being "Green," I have inserted code in templates that
>> intercepted a users attempt to print the documents if the left or
>> right margin was greater than 1 inch.
>>
>> This process was pretty straight forward in Word 2003 where I simply
>> used macros named "FilePrint" and "FileDefaultPrint" to intercept
>> the user actions and test for proper margins.
>>
>> In Word2007, I repurposed the "FilePrint" and "FileQuickPrint" ribbon
>> controls and used a VBA callback to test for proper margins.
>>
>> Concern started to rise when I saw a message from Jay Freeman a few
>> monts ago concerning the new interface in Word 2010:
>>
>> "The FilePrint command, built-in or macro, seems to be obsolete. I
>> haven't found any way to intercept the Print button in the Print and
>> Preview screen. Although using the Ctrl+Alt+NumPadPlus shortcut (the
>> ToolsCustomizeKeyboardShortcut command) appears to show the Print
>> button calling the FilePrint command, a macro named FilePrint won't
>> intercept the button click."
>>
>> I installed Word2010 a week or so ago and have confirmed Jay's
>> observations. Like Jay, I was also unable to find a way to intercept
>> the Print button that is located on the File>Print Tab.
>>
>> From what I have been able to determine so far, this "Print" button
>> is a built-in control that is part a "GroupPrintSetting" built-in
>> group, that is part of a "PrintTab" built-in tab, that is part of
>> the new Backstage UI.
>>
>> I still have a lot to learn about all these new things, but what I
>> have learned so far is very disappointing.
>>
>> First, it appears that none of the built-in controls of the
>> Backstage UI can be repurposed.  This is FAQ published by Microsoft::
>>
>> "Can I repurpose one of the existing definitive command buttons, fast
>> command buttons, or tabs by changing its onAction callback
>> attribute? For example can I change the file Save button so that is
>> has an additional type, or displays only one file type?
>>
>> It is not possible to override these commands from the custom UI XML
>> markup or by using the object model. Using the DocumentBeforeSave
>> event is one alternative, but using that doesn't really change the
>> functionality of the individual commands that show up in the Change
>> File Type gallery in the Backstage. A better solution would be to
>> consider hiding the built-in UI and rebuilding it fully with custom
>> commands." Secondly, unlike built-in ribbon controls, it doesn't appear 
>> that
>> you can add built-in Backstage controls to new custom tabs or groups.
>>
>> Next, again unlike built-in ribbon controls, the backstage controls
>> don't appear to be dynamic i.e., you can't set attributes like
>> "getVisible" using VBA callbacks.
>>
>> Like the FAQ suggests, about all you can do is hide the built in
>> controls and then attempt to cobble together custom controls to meet
>> your needs. This is what I did here.
>>
>> 1.  I wrote a XML script that:
>>
>>     a.   repurposes the "FilePrintQuick" control that you can still
>> add to the ribbon or QAT.
>>     b.  hides the backstage "PrintTab" "GroupPrintSettings" control
>>     c.  Added a new "PRINT" and "QUICK PRINT" custom control to the
>> "Print Tab"
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> <customUI
>> xmlns="http://schemas.microsoft.com/office/2009/07/customui">
>> <commands> <command idMso="FilePrintQuick"
>> onAction="BackStage.RepurposedQuickPrint"/>
>> </commands>
>> <backstage>
>> <tab idMso="TabPrint" >
>> <firstColumn >
>> <group idMso="GroupPrintSettings" visible="false" />
>> <group id="customPrinter" label="Print"
>> insertAfterMso="GroupPrintSettings"
>>>
>> <primaryItem>
>> <button id="custPrint" label="PRINT" imageMso="PrintAreaMenu"
>> isDefinitive="true" onAction="BackStage.OnAction" screentip="Select a
>> printer, number of copies, and other printer options before
>> printing." /> </primaryItem>
>> </group>
>> <group id="customQuikPrinter" label="Quick Print">
>> <primaryItem>
>> <button id="custQuickPrint" label="QUICK PRINT"
>> imageMso="FilePrintQuick" isDefinitive="true"
>> onAction="BackStage.OnAction" screentip="Send the document directly
>> to the default printer without making changes." /> </primaryItem>
>> </group>
>> </firstColumn>
>> </tab>
>> </backstage>
>> </customUI>
>>
>> In the template, I added a module "Backstage" containing the
>> following VBA callbacks:
>>
>> Option Explicit
>> Sub OnAction(control As IRibbonControl)
>> Select Case True
>>  Case ActiveDocument.PageSetup.RightMargin > 72
>>    MsgBox "Set green document margins and try again."
>>  Case ActiveDocument.PageSetup.LeftMargin > 72
>>    MsgBox "Set green document margins and try again."
>>  Case Else
>>    Select Case control.ID
>>      Case "custPrint"
>>         Application.Dialogs(wdDialogFilePrint).Show
>>      Case "custQuickPrint"
>>         CommandBars.ExecuteMso ("FilePrintQuick")
>>     End Select
>> End Select
>> End Sub
>>
>> Private Sub RepurposedQuickPrint(ByVal control As IRibbonControl,
>> ByRef cancelDefault)
>> cancelDefault = True
>> Select Case True
>>  Case ActiveDocument.PageSetup.RightMargin > 72
>>    MsgBox "Set green document margins and try again."
>>  Case ActiveDocument.PageSetup.LeftMargin > 72
>>    MsgBox "Set green document margins and try again."
>>  Case Else
>>    cancelDefault = False
>> End Select
>> End Sub
>>
>> I realize this process seems and is clunky.  I would certainly be
>> nice if it were possilbe to simple hide the "PRINT" button on the
>> "PrintGroupSettings" controls and add a custom button in its place,
>> but unless I am missing something that isn't possible.
>>
>> Open to any comments or suggestions for improving this process.
>>
>>
>> --
>> Greg Maxey
>>
>> See my web site http://gregmaxey.mvps.org
>> for an eclectic collection of Word Tips.
>>
>> Arrogance is a weed that grows mostly on a dunghill (Arabic proverb) 


0
Reply Greg 5/1/2010 2:31:35 AM
I don't know Greg - there was an example and then the Dynamic function was 
removed. Perhaps because of Web Apps who knows?

"Greg Maxey" <gmaxey@mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in message 
news:#snWkZN6KHA.348@TK2MSFTNGP02.phx.gbl...
> Removing features that worked and that improved UI flexibility seems to be 
> step backwards.  Do you think that is where MS is headed?
>
> Janine wrote:
>> Greg
>>
>> They dynamic feature was removed a while ago.
>>
>> Janine
>>
>> "Greg Maxey" <gmaxey@mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> wrote in
>> message news:OdXic7L6KHA.4940@TK2MSFTNGP05.phx.gbl...
>>> While I can't say that I am thrilled by the steps taken to get here,
>>> I think I have figured out a way to at least simulate intercepting
>>> Word's "Print" command in Word 2010.
>>>
>>> I have a couple of Word 2003 and Word 2007 templates where in the
>>> interest of being "Green," I have inserted code in templates that
>>> intercepted a users attempt to print the documents if the left or
>>> right margin was greater than 1 inch.
>>>
>>> This process was pretty straight forward in Word 2003 where I simply
>>> used macros named "FilePrint" and "FileDefaultPrint" to intercept
>>> the user actions and test for proper margins.
>>>
>>> In Word2007, I repurposed the "FilePrint" and "FileQuickPrint" ribbon
>>> controls and used a VBA callback to test for proper margins.
>>>
>>> Concern started to rise when I saw a message from Jay Freeman a few
>>> monts ago concerning the new interface in Word 2010:
>>>
>>> "The FilePrint command, built-in or macro, seems to be obsolete. I
>>> haven't found any way to intercept the Print button in the Print and
>>> Preview screen. Although using the Ctrl+Alt+NumPadPlus shortcut (the
>>> ToolsCustomizeKeyboardShortcut command) appears to show the Print
>>> button calling the FilePrint command, a macro named FilePrint won't
>>> intercept the button click."
>>>
>>> I installed Word2010 a week or so ago and have confirmed Jay's
>>> observations. Like Jay, I was also unable to find a way to intercept
>>> the Print button that is located on the File>Print Tab.
>>>
>>> From what I have been able to determine so far, this "Print" button
>>> is a built-in control that is part a "GroupPrintSetting" built-in
>>> group, that is part of a "PrintTab" built-in tab, that is part of
>>> the new Backstage UI.
>>>
>>> I still have a lot to learn about all these new things, but what I
>>> have learned so far is very disappointing.
>>>
>>> First, it appears that none of the built-in controls of the
>>> Backstage UI can be repurposed.  This is FAQ published by Microsoft::
>>>
>>> "Can I repurpose one of the existing definitive command buttons, fast
>>> command buttons, or tabs by changing its onAction callback
>>> attribute? For example can I change the file Save button so that is
>>> has an additional type, or displays only one file type?
>>>
>>> It is not possible to override these commands from the custom UI XML
>>> markup or by using the object model. Using the DocumentBeforeSave
>>> event is one alternative, but using that doesn't really change the
>>> functionality of the individual commands that show up in the Change
>>> File Type gallery in the Backstage. A better solution would be to
>>> consider hiding the built-in UI and rebuilding it fully with custom
>>> commands." Secondly, unlike built-in ribbon controls, it doesn't appear 
>>> that
>>> you can add built-in Backstage controls to new custom tabs or groups.
>>>
>>> Next, again unlike built-in ribbon controls, the backstage controls
>>> don't appear to be dynamic i.e., you can't set attributes like
>>> "getVisible" using VBA callbacks.
>>>
>>> Like the FAQ suggests, about all you can do is hide the built in
>>> controls and then attempt to cobble together custom controls to meet
>>> your needs. This is what I did here.
>>>
>>> 1.  I wrote a XML script that:
>>>
>>>     a.   repurposes the "FilePrintQuick" control that you can still
>>> add to the ribbon or QAT.
>>>     b.  hides the backstage "PrintTab" "GroupPrintSettings" control
>>>     c.  Added a new "PRINT" and "QUICK PRINT" custom control to the
>>> "Print Tab"
>>>
>>> <?xml version="1.0" encoding="utf-8" ?>
>>> <customUI
>>> xmlns="http://schemas.microsoft.com/office/2009/07/customui">
>>> <commands> <command idMso="FilePrintQuick"
>>> onAction="BackStage.RepurposedQuickPrint"/>
>>> </commands>
>>> <backstage>
>>> <tab idMso="TabPrint" >
>>> <firstColumn >
>>> <group idMso="GroupPrintSettings" visible="false" />
>>> <group id="customPrinter" label="Print"
>>> insertAfterMso="GroupPrintSettings"
>>>>
>>> <primaryItem>
>>> <button id="custPrint" label="PRINT" imageMso="PrintAreaMenu"
>>> isDefinitive="true" onAction="BackStage.OnAction" screentip="Select a
>>> printer, number of copies, and other printer options before
>>> printing." /> </primaryItem>
>>> </group>
>>> <group id="customQuikPrinter" label="Quick Print">
>>> <primaryItem>
>>> <button id="custQuickPrint" label="QUICK PRINT"
>>> imageMso="FilePrintQuick" isDefinitive="true"
>>> onAction="BackStage.OnAction" screentip="Send the document directly
>>> to the default printer without making changes." /> </primaryItem>
>>> </group>
>>> </firstColumn>
>>> </tab>
>>> </backstage>
>>> </customUI>
>>>
>>> In the template, I added a module "Backstage" containing the
>>> following VBA callbacks:
>>>
>>> Option Explicit
>>> Sub OnAction(control As IRibbonControl)
>>> Select Case True
>>>  Case ActiveDocument.PageSetup.RightMargin > 72
>>>    MsgBox "Set green document margins and try again."
>>>  Case ActiveDocument.PageSetup.LeftMargin > 72
>>>    MsgBox "Set green document margins and try again."
>>>  Case Else
>>>    Select Case control.ID
>>>      Case "custPrint"
>>>         Application.Dialogs(wdDialogFilePrint).Show
>>>      Case "custQuickPrint"
>>>         CommandBars.ExecuteMso ("FilePrintQuick")
>>>     End Select
>>> End Select
>>> End Sub
>>>
>>> Private Sub RepurposedQuickPrint(ByVal control As IRibbonControl,
>>> ByRef cancelDefault)
>>> cancelDefault = True
>>> Select Case True
>>>  Case ActiveDocument.PageSetup.RightMargin > 72
>>>    MsgBox "Set green document margins and try again."
>>>  Case ActiveDocument.PageSetup.LeftMargin > 72
>>>    MsgBox "Set green document margins and try again."
>>>  Case Else
>>>    cancelDefault = False
>>> End Select
>>> End Sub
>>>
>>> I realize this process seems and is clunky.  I would certainly be
>>> nice if it were possilbe to simple hide the "PRINT" button on the
>>> "PrintGroupSettings" controls and add a custom button in its place,
>>> but unless I am missing something that isn't possible.
>>>
>>> Open to any comments or suggestions for improving this process.
>>>
>>>
>>> --
>>> Greg Maxey
>>>
>>> See my web site http://gregmaxey.mvps.org
>>> for an eclectic collection of Word Tips.
>>>
>>> Arrogance is a weed that grows mostly on a dunghill (Arabic proverb)
>
> 
0
Reply Janine 5/1/2010 3:29:57 AM
Follow
Email
Reply:
Similar Artilces:

My print no longer matches my print preview, help?
I have printed on several occassions without incident, suddenly it is compressing text to half page. Any ideas? It is a printer setting. Look for something like *print document on* and a size box. Some sort of zoom feature. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Cheryl" <Cheryl@discussions.microsoft.com> wrote in message news:9D16F72E-EDF1-4DA6-9340-DC01E990913E@microsoft.com... >I have printed on several occassions without incident, suddenly it is > compressing text to half page. Any ideas? ...

Show grid lines when printing?
I have a few exported reports from Access but I cant get the Grid lines to print. How do I go about this? I have colums but no gridlines. Please help! Tools>Options>Gridlines>OK -- HTH, Gary Brown gary.DeleteThis2SendMeAnEmail.Brown@kinneson.com If this post was helpful to you, please select ''YES'' at the bottom of the post. "TKM" wrote: > I have a few exported reports from Access but I cant get the Grid lines to > print. How do I go about this? I have colums but no gridlines. Please help! Gridlines don't print. I presume you're seei...

Print button on toolbar linked to specific printer, way to do?
Argggh, they keep changing colour printers on us <lol>! I'm in a govt dept that balloons up/deflates due to election events! In the last 2 weeks, they've changed all the printers around on us as they move them to accommodate needs! At the end of the event, the printers will all return back to their original configurations and locations <phew>! The colour printer is the one that concerns me. Is there a way to just assign a printer, via a macro maybe, to a button on the toolbar? That way, no matter what printer was actually there and no matter where it was locat...

Batch status is "printing"
client has a GL batch that is showing status of "printing". What are steps to clear? Will the same process work that you would use if the status was "posting" or "busy", etc? "DavidInterDyn" wrote: > client has a GL batch that is showing status of "printing". What are steps to > clear? David, Have a look at KB 869653 on PartnerSource. The same process is used for any batch that is hung up in the posting process. Hope this helps, Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com...

Problem print document in Word
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have a document , in which what I see as the completed one on my screen <br> is not printing properly,the printed document ( a menu) is cutting sentences in half, horizontally and down the sides of the margins. I have my document exactly how I want it on my computer screen, but it is <br> just not translating out to my printed page. Please help , don't understand <br> what exactly I'm doing wrong. Thank you Make certain that Office & OS X are fully updated, but most importantly...

How avoid format problems converting email to print newsletter?
I have a newsletter with about five two to three paragraph stories and a calendar of events. I want a quick way for online readers to read details about stories of interest from links in the email. I then want to use all the work I put into the email version to make a printable newsletter. Is this possible? Or should I go vice versa, working on the print version and converting it to email? I am almost considering a professional service to avoid the hassle of re-formatting. I can't do away with the print version altogether, but it is just not easy to read online for busy people who d...

Printing as Book
On earlier versions of Publisher I could print a multipaged document as a book and it would automatically print the pages in the correct order for binding. I cannot find how to do this in Publisher 2007. Can anyone advise please. MargaretB It is the same in 2007. In page setup the easiest setup is Advanced on the right. Select booklet. Do you have a duplex unit? If not go through the printing wizard found at the Advanced Printing Options. -- Mary Sauer http://msauer.mvps.org/ "MargaretB" <invalid@invalid.inv> wrote in message news:ualArSM$K...

Page number displays in code when previewing or printing
When I assign a page number using the "add page number" command, the numbers in the example dialog boxes appear in code (as listed below), but will appear as numbers as I'm creating the document (in Word 2007) after I choose an example. When I preview my work in print preview or actually print my document or any other documents sent to me with page numbers, this appears on the paper where the number should be: ( PAGE / *MERGEFORMAT ) Is there a way to correct this in word 2007 so in the examples it shows the numbers but not the code and so when I print out my pa...

Repeat rows or columns as headers when printing?
When printing a range that will cover a few pages, is it possible to repeat the header rows or columns on every page (like Word's option for table layouts)? Ed File|Page setup|Sheet tab| click rows to repeat at top and select the rows you want with the mouse. As an aside, if you want to always see those same rows while you're editting the data (say rows 1:3), you can select A1 (just so that it's visible), then select A4. Window|freeze panes Everything above the selected cell will always be visible. And if you selected C4, then everything above that cell and everything ...

cannot print from Outlook 2003
Would be appreciative of any input on the problem of print services suddently not available in Outlook 2003 (w/BCM). Get event error ID: 1000 but, nothing in Knowledge Base nor Help and Support Center references it (at least that I could find). Short of a re-install, I'm taxed. I have multiple users with this issue. Any ideas would be very much appreciated. Peace! ...

Defining Print Ranges From Pivot Tables
I have a Excel Spreadsheet that contains 3 workbooks, two of which contain data, one of which contains data which my pivot table on the third workbook feeds off. When in the pivot table i have added 4 four more columns of calculations on the right hand side of the pivot table. These columns use data from the pivot table and the data sheet to perform the calculations. As the amount of data changes variably on what is selected from a field within the pivot table i have had to use iserror and isna formulas so when there is only a short table the colums to the right return blanks rather than error...

Printing Problem #3
I have publisher 2000, trying to print on a 5 x 8 index card, the publication keeps getting cut off. any ideas? I am using a deskjet printer. Lori wrote: > I have publisher 2000, trying to print on a 5 x 8 index > card, the publication keeps getting cut off. any ideas? > I am using a deskjet printer. 1) There are no printing issues that can be directly attributed to /any/ version. 2) The HP DeskJet line is now fairly ancient and none of them were capable (to the best of my knowledge, I've never owned one) of 'full bleed'. This is a limitation of your printer and...

Printing #9
I work like to know how to set up the print function so I can print multiple worksheets in the same wookbook by just clicking the print button. Hi Tom Select the Sheets and print Don't forget to ungroup the sheets Or use VBA ActiveWorkbook.PrintOut 'the whole workbook Worksheets.PrintOut 'all worksheets Sheets.PrintOut 'all sheets Sheets(Array("Sheet1", "Sheet3")).PrintOut 'all sheets in the array ActiveWindow.SelectedSheets.PrintOut 'print all selected sheets ActiveSheet.PrintOut 'only the activesheet Sheets("Sheet1").Print...

Include Row number to print
Hi Expert, How could I include the row number in my printing? Thanks for your help. One thing more, Can I copy the row number only to another sheet? "Rechie" wrote: > Hi Expert, > > How could I include the row number in my printing? > > Thanks for your help. The ROW() function will return the row number. =ROW() will always return the current row number =ROW(A5) will return the row number of the referenced cell (5 in this case) on another sheet you could use something like: =ROW('First Sheet Name'!A5) which would return 5 also. &qu...

Purchase Order Print Flag
We don't usually physically print our Purchase Orders as most go electronically to our suppliers (we eConnect them into GP from another system that sends them). The trouble with this is that without running through the print process the PO's are not showing up in "avaiable to promise" window. We've tried a few SQL triggers etc to change status fields in the underlying tables, but although that works it seems to conflict with other settings that then mark the PO as unable to edit. Anyone been through anything similar before?? Many Thanks. Jason, Same trouble her...

printing
I created a simple line graph and cannot get it to print correctly. The verticle and horizontal axes both print OK, but the graph size is about 25% and prints in the top left corner. Thanks for any suggestions. johna, There could be at least two issues here. First check "Print preview", if it looks like what you described. Select "View", "Page break preview". If there isn't a blue bold line around what you what to print, drag and drop the line to a more managable size. One or two cells larger than what you what to print. If the above is not the case: S...

How to Print Receivings Transactions
How can we print from the Receivings Transactions Inquiry Zoom window in Purchase Order? Ken, There are a number of screens in GP that still do not have a Print icon. The only way to print the information on these screens is to capture a screenshot and print that. -- Victoria Yudin Dynamics GP MVP "Ken A" <reade123@hotmail.com> wrote in message news:eY5vJHsIHHA.960@TK2MSFTNGP04.phx.gbl... > How can we print from the Receivings Transactions Inquiry Zoom window in > Purchase Order? > > Yep, that's what we came up with too. Thanks for the reply. "...

Printing #2
I understand that NLQ printing is default in windows. Is there any way one can get a quick draft print of excel reports on a dot matrix printer by changing the printer driver or fonts for instance? Thank you. Hiren, I'm not sure about this setting, but try "Draft quality" in File - Page setup - Sheet. -- Earl Kiosterud mvpearl omitthisword at verizon period net President Bush on sovereignty: http://www.tastefullystated.com/sovereignty.wmv ------------------------------------------- "Hiren Shah" <hiren_shah50@hotmail.com> wrote in message news:054901c4961...

Duplex Document printed but then printed an extra "blank" page?
Anyone know why this occurred? I was able to print the Duplex Booklet document ok but then it printed an extra blank page? Any ideas on why this occurred? Publisher works with groups of four, if you have an odd number of pages such as 10, you will get a blank sheet. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Lis" <Lis@discussions.microsoft.com> wrote in message news:7712C5E6-2FBC-417F-98AD-75E3766627D5@microsoft.com... > Anyone know why this occurred? > > I was able to print the Duplex Booklet docu...

Why am I stuck in greyscale when printing my business cards?
In Publisher/Office2007, I changed my logo. Now as I view the publication, the colors are perfect, however as I go to print or preview, it changes to greyscale only. My publication should be red/white and blue...not grey. This was a HP printer problem. As near as I can ascertain this is fixed in the service packs. http://office.microsoft.com/en-us/downloads/default.aspx Or if not you might want to check the web site of your model printer for an updated driver. -- Mary Sauer http://msauer.mvps.org/ "electric dave" <electric dave@discussions.microsoft.com> wrote in messa...

I need to save or print my desktop background photo
I saved a photo as my desktop background and now I need to save it or print it. It came from a website that has changed the photo and I did not save it on my computer except as a desktop background photo. With the Desktop showing, press the Print Scrn key, open Paint, Paste, then Save as..... -- Don Vancouver, USA "wellheadman" <wellheadman@discussions.microsoft.com> wrote in message news:38D6C482-136A-40BE-820F-2D547120860C@microsoft.com... >I saved a photo as my desktop background and now I need to save it or print > it. It came from a website that has change...

Printing from Outlook folder
I made a rule that when I receive an email from a specific persons it goes to different folder and prints. Now I want that the folder will print to a specific printer, example: Folder a will print to Printer A and Folder B will print to Printer B and if possible without the headers. Is it possible and if yes how ? No, that's not possible. Outlook has no such settings.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users...

Print in borders
How does one tpe inside a clip-art border? Ruth wrote: > How does one tpe inside a clip-art border? And that's an Outlook problem? -- Gordon Burgess-Parker Interim Systems and Management Accounting www.gbpcomputing.co.uk ...

Printing from within PUB and as a jpg
Win XP-Home - all current updates. Inserted images into a Publisher 2002 document. Printed the PUB page from within PUB. All image sizes are correct. Then saved the PUB page as SAVE-AS - .jpg. Printed the .jpg thru MSFT Photo Print Wizard. Images printed 3/4 the size as the original images as printed thru PUB. Appreciate all advice for this problem. Thanks. lars Do you get the same result if you right-click the publication, save as picture? -- Mary Sauer http://msauer.mvps.org/ "lar" <lar@discussions.microsoft.com> wrote in message news:808DEE2B-5D...

How can I get MS Publisher 2002 to print on Avery 8371 template?
I am trying to print a business card on an Avery 8371 template. Publisher 2002 always defaults to an Avery for Word Wizard. The 8371 business card is a standard 3.5 x 2. http://www.avery.com/us/Main?action=product.Details&catalogcode=WEB01&node=10211401&productcode=5371 In Publisher, file, page setup, business card... Click "change copies per sheet" .75 side, .5 top, zero gaps. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Helmer" <Helmer@discussions.microsoft.com> wrote in message news:A531...