View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 7
Default VBA code to locate the command bar number the printer button is on

Norman Jones wrote:
Hi JK,

My code should locate instances of the Print control on any visible toolbar
whereas your code limits any search to a single toolbar. Additionally, if
the user employed a non-English language version of Excel (using an
alternative name), your code adaptation would fail to disclose any instance
of the control.

The control id for the print control (4) is unique to that control and no
confusion with the Print Preview control (whose unique id is 109) should be
possible. In any event, a search based on a unique id should be
intrinsically more reliable than a search based on the control's caption,
which depends on the version language and can be altered using VBA.


---
Regards,
Norman


Hi Norman,

you're absolutely right. I was thinking that the need was to insert it
into the 'Standard' bar (and in English).
I also didn't remember that control id thing. Inspired by your reply I
now have the list of control IDs in my bookmarks. :)
But the ID for 'Print' in the 'Standard' toolbar is 2521 instead of 4
(Office 2000).
(http://support.microsoft.com/default...BLN%5D;Q213552)
Weird...

Thanks anyways,

JK