Discussion:
Black Belt Problem: How to load 20x20 icons in Word (Office CommandBarButton)
(too old to reply)
keepITcool
2006-07-19 12:56:45 UTC
Permalink
Fletcher...

My guess: you have set your desktop to Large size 120 DPI.
(display properties/settings/advanced/general)

If you have 96DPI (the default) icons are their normal size of 16x16,
with no stretching and distortion.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
** reward for solution! **
Can anybody tell me how to accurately load the contents of a 20x20
bitmap (or even a 16x16 bitmap) into an Office CommandBarButton in
Word? I've been trying to get this to work, and tearing my hair out
(so please accept my apologies for posting to 3 groups.)
I have examined the Office CommandBars in Word 2003 in detail, using
magnifier. It is quite clear that the icons are generally 20x20.
However, when I tried to load my 20x20 .BMP file as an Icon Image,
using the documented procedure, I found that that contents were
getting badly distorted. Further experimentation revealed (with a
If I loaded a 16x16 .BMP, the contents were being preserved.
However, when it was renderd, then out of every 4 rows of pixels, the
3rd row was being repeated 2x, in order to fill 20 rows. Similarly,
out of every 4 columns, the 3rd was being repeated 2x. That's not so
surprising.
HOWEVER, if I loaded a 20x20, then 1 out of every 5 rows (and 1 out
of every 5 colums) were being deleted, in order to store a 16x16
image! Then, when displayed, 1 of every 4 of the remaining rows was
being duplicated, to blow it back up to 20x20. If you want to see
how crappy this looks, you can examine the "MapPoint" icon, which
seems to display this problem.
If you take one of Word's quality 20x20 icons, and use R-click
Toolbar | Customize | Modify Selection | Copy Face, and then you
paste into a .BMP editor such as Paintbrush, you will get a 16x16
image, missing 4 rows and 4 columns. If you use VBA code to grab the
picture, and use StdOLE.StdFunctions.SavePicture, to create a .BMP
file, then you also get 16x16. HOWEVER if you paste onto the face of
another button, you will get a true duplicate of the original icon.
This would tend to indicate that there is a different Clipboard
format (i.e. other than .bmp) which is being used when the picture is
being transferred <from and to> an Office Command Bar.
VBA Code follows after my signature. I've also attached a small .zip
with the .dot and some sample files. Unzip everything into one
folder, open LoadIcons.dot, and then click the "LoadIcons" button on
the floating toolbar.
j***@gmail.com
2006-07-19 16:28:16 UTC
Permalink
you need to use loadpicture method with masking.
here goes
http://support.microsoft.com/default.aspx?scid=kb;en-us;286460
Post by keepITcool
Fletcher...
My guess: you have set your desktop to Large size 120 DPI.
(display properties/settings/advanced/general)
If you have 96DPI (the default) icons are their normal size of 16x16,
with no stretching and distortion.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
** reward for solution! **
Can anybody tell me how to accurately load the contents of a 20x20
bitmap (or even a 16x16 bitmap) into an Office CommandBarButton in
Word? I've been trying to get this to work, and tearing my hair out
(so please accept my apologies for posting to 3 groups.)
I have examined the Office CommandBars in Word 2003 in detail, using
magnifier. It is quite clear that the icons are generally 20x20.
However, when I tried to load my 20x20 .BMP file as an Icon Image,
using the documented procedure, I found that that contents were
getting badly distorted. Further experimentation revealed (with a
If I loaded a 16x16 .BMP, the contents were being preserved.
However, when it was renderd, then out of every 4 rows of pixels, the
3rd row was being repeated 2x, in order to fill 20 rows. Similarly,
out of every 4 columns, the 3rd was being repeated 2x. That's not so
surprising.
HOWEVER, if I loaded a 20x20, then 1 out of every 5 rows (and 1 out
of every 5 colums) were being deleted, in order to store a 16x16
image! Then, when displayed, 1 of every 4 of the remaining rows was
being duplicated, to blow it back up to 20x20. If you want to see
how crappy this looks, you can examine the "MapPoint" icon, which
seems to display this problem.
If you take one of Word's quality 20x20 icons, and use R-click
Toolbar | Customize | Modify Selection | Copy Face, and then you
paste into a .BMP editor such as Paintbrush, you will get a 16x16
image, missing 4 rows and 4 columns. If you use VBA code to grab the
picture, and use StdOLE.StdFunctions.SavePicture, to create a .BMP
file, then you also get 16x16. HOWEVER if you paste onto the face of
another button, you will get a true duplicate of the original icon.
This would tend to indicate that there is a different Clipboard
format (i.e. other than .bmp) which is being used when the picture is
being transferred <from and to> an Office Command Bar.
VBA Code follows after my signature. I've also attached a small .zip
with the .dot and some sample files. Unzip everything into one
folder, open LoadIcons.dot, and then click the "LoadIcons" button on
the floating toolbar.
Fletcher James
2006-07-29 15:18:34 UTC
Permalink
Right you are! Thanks.
--
Fletcher James
President
Levit & James, Inc.

(703)771-1549
MailTo:***@levitjames.com
http://www.levitjames.com
Post by keepITcool
Fletcher...
My guess: you have set your desktop to Large size 120 DPI.
(display properties/settings/advanced/general)
If you have 96DPI (the default) icons are their normal size of 16x16,
with no stretching and distortion.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
** reward for solution! **
Can anybody tell me how to accurately load the contents of a 20x20
bitmap (or even a 16x16 bitmap) into an Office CommandBarButton in
Word? I've been trying to get this to work, and tearing my hair out
(so please accept my apologies for posting to 3 groups.)
I have examined the Office CommandBars in Word 2003 in detail, using
magnifier. It is quite clear that the icons are generally 20x20.
However, when I tried to load my 20x20 .BMP file as an Icon Image,
using the documented procedure, I found that that contents were
getting badly distorted. Further experimentation revealed (with a
If I loaded a 16x16 .BMP, the contents were being preserved.
However, when it was renderd, then out of every 4 rows of pixels, the
3rd row was being repeated 2x, in order to fill 20 rows. Similarly,
out of every 4 columns, the 3rd was being repeated 2x. That's not so
surprising.
HOWEVER, if I loaded a 20x20, then 1 out of every 5 rows (and 1 out
of every 5 colums) were being deleted, in order to store a 16x16
image! Then, when displayed, 1 of every 4 of the remaining rows was
being duplicated, to blow it back up to 20x20. If you want to see
how crappy this looks, you can examine the "MapPoint" icon, which
seems to display this problem.
If you take one of Word's quality 20x20 icons, and use R-click
Toolbar | Customize | Modify Selection | Copy Face, and then you
paste into a .BMP editor such as Paintbrush, you will get a 16x16
image, missing 4 rows and 4 columns. If you use VBA code to grab the
picture, and use StdOLE.StdFunctions.SavePicture, to create a .BMP
file, then you also get 16x16. HOWEVER if you paste onto the face of
another button, you will get a true duplicate of the original icon.
This would tend to indicate that there is a different Clipboard
format (i.e. other than .bmp) which is being used when the picture is
being transferred <from and to> an Office Command Bar.
VBA Code follows after my signature. I've also attached a small .zip
with the .dot and some sample files. Unzip everything into one
folder, open LoadIcons.dot, and then click the "LoadIcons" button on
the floating toolbar.
Jean-Guy Marcil
2006-07-29 15:34:41 UTC
Permalink
Post by Fletcher James
Right you are! Thanks.
Post by keepITcool
Fletcher...
My guess: you have set your desktop to Large size 120 DPI.
(display properties/settings/advanced/general)
If you have 96DPI (the default) icons are their normal size of 16x16,
with no stretching and distortion.
--
keepITcool
Post by keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam
** reward for solution! **
And the reward was...?

:-p
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
***@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Fletcher James
2006-08-01 15:10:01 UTC
Permalink
As Jean-Guy pointed out, I offered a reward, and you solved the problem (and
saved me a lot of trouble.) You appear to have kept your e-mail address
secret, so please contact me directly, to arrange for fulfillment.
--
Fletcher James
President
Levit & James, Inc.

(703)771-1549
MailTo:***@levitjames.com
http://www.levitjames.com
Post by keepITcool
Fletcher...
My guess: you have set your desktop to Large size 120 DPI.
(display properties/settings/advanced/general)
If you have 96DPI (the default) icons are their normal size of 16x16,
with no stretching and distortion.
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
** reward for solution! **
Can anybody tell me how to accurately load the contents of a 20x20
bitmap (or even a 16x16 bitmap) into an Office CommandBarButton in
Word? I've been trying to get this to work, and tearing my hair out
(so please accept my apologies for posting to 3 groups.)
I have examined the Office CommandBars in Word 2003 in detail, using
magnifier. It is quite clear that the icons are generally 20x20.
However, when I tried to load my 20x20 .BMP file as an Icon Image,
using the documented procedure, I found that that contents were
getting badly distorted. Further experimentation revealed (with a
If I loaded a 16x16 .BMP, the contents were being preserved.
However, when it was renderd, then out of every 4 rows of pixels, the
3rd row was being repeated 2x, in order to fill 20 rows. Similarly,
out of every 4 columns, the 3rd was being repeated 2x. That's not so
surprising.
HOWEVER, if I loaded a 20x20, then 1 out of every 5 rows (and 1 out
of every 5 colums) were being deleted, in order to store a 16x16
image! Then, when displayed, 1 of every 4 of the remaining rows was
being duplicated, to blow it back up to 20x20. If you want to see
how crappy this looks, you can examine the "MapPoint" icon, which
seems to display this problem.
If you take one of Word's quality 20x20 icons, and use R-click
Toolbar | Customize | Modify Selection | Copy Face, and then you
paste into a .BMP editor such as Paintbrush, you will get a 16x16
image, missing 4 rows and 4 columns. If you use VBA code to grab the
picture, and use StdOLE.StdFunctions.SavePicture, to create a .BMP
file, then you also get 16x16. HOWEVER if you paste onto the face of
another button, you will get a true duplicate of the original icon.
This would tend to indicate that there is a different Clipboard
format (i.e. other than .bmp) which is being used when the picture is
being transferred <from and to> an Office Command Bar.
VBA Code follows after my signature. I've also attached a small .zip
with the .dot and some sample files. Unzip everything into one
folder, open LoadIcons.dot, and then click the "LoadIcons" button on
the floating toolbar.
Loading...