Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Select standard toolbar button option

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Select standard toolbar button option

Sure. Turn on the macro recorder while you do it manually or sample code.

.Style = msoButtonIconAndCaption

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Select standard toolbar button option

Thank you
--
Gary''s Student
gsnu200710


"Tom Ogilvy" wrote:

Sure. Turn on the macro recorder while you do it manually or sample code.

.Style = msoButtonIconAndCaption

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Select standard toolbar button option

Code like this...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
Set ctl = cbr.Controls("Open")
ctl.Style = msoButtonIconAndCaption
End Sub

or did you want the customize dialog
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Select standard toolbar button option

Thank you.

I'll use it in this form. Don't need a dialog since I'll be doing it in
loops.

Thanks again.
--
Gary's Student
gsnu200710


"Jim Thomlinson" wrote:

Code like this...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
Set ctl = cbr.Controls("Open")
ctl.Style = msoButtonIconAndCaption
End Sub

or did you want the customize dialog
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Select standard toolbar button option

Not that you need the loop code but...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
For Each ctl In cbr.Controls
ctl.Style = msoButtonIconAndCaption
Next ctl
End Sub
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

Thank you.

I'll use it in this form. Don't need a dialog since I'll be doing it in
loops.

Thanks again.
--
Gary's Student
gsnu200710


"Jim Thomlinson" wrote:

Code like this...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
Set ctl = cbr.Controls("Open")
ctl.Style = msoButtonIconAndCaption
End Sub

or did you want the customize dialog
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select standard toolbar button option

Jim/Student,
I doubt this code will be run, but just a heads up, the Standard commandbar
has 3 types of controls:

CommandBarPopup &Paste
CommandBarButton &Format Painter
CommandBarComboBox &Undo

as examples. The CommandBarCombobox has a style property, but it doesn't
support msobuttonIconandCaption. The CommandBarPopup doesn't have a style
property.

So this code will produce an error after changing some of the buttons.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Not that you need the loop code but...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
For Each ctl In cbr.Controls
ctl.Style = msoButtonIconAndCaption
Next ctl
End Sub
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

Thank you.

I'll use it in this form. Don't need a dialog since I'll be doing it in
loops.

Thanks again.
--
Gary's Student
gsnu200710


"Jim Thomlinson" wrote:

Code like this...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
Set ctl = cbr.Controls("Open")
ctl.Style = msoButtonIconAndCaption
End Sub

or did you want the customize dialog
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and
select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Select standard toolbar button option

Thanks Tom... One way...
Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
For Each ctl In cbr.Controls
With ctl
If .Type = msoControlButton Then .Style = msoButtonIconAndCaption
End With
Next ctl
End Sub

Or you could just use on error resume next with the previous code...
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

Jim/Student,
I doubt this code will be run, but just a heads up, the Standard commandbar
has 3 types of controls:

CommandBarPopup &Paste
CommandBarButton &Format Painter
CommandBarComboBox &Undo

as examples. The CommandBarCombobox has a style property, but it doesn't
support msobuttonIconandCaption. The CommandBarPopup doesn't have a style
property.

So this code will produce an error after changing some of the buttons.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Not that you need the loop code but...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
For Each ctl In cbr.Controls
ctl.Style = msoButtonIconAndCaption
Next ctl
End Sub
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

Thank you.

I'll use it in this form. Don't need a dialog since I'll be doing it in
loops.

Thanks again.
--
Gary's Student
gsnu200710


"Jim Thomlinson" wrote:

Code like this...

Sub test()
Dim cbr As CommandBar
Dim ctl As CommandBarControl

Set cbr = Application.CommandBars("Standard")
Set ctl = cbr.Controls("Open")
ctl.Style = msoButtonIconAndCaption
End Sub

or did you want the customize dialog
--
HTH...

Jim Thomlinson


"Gary''s Student" wrote:

On the worksheet I can pull-down:
View Toolbars Customize
I can then right-click any of the standard toolbar buttons and
select:
Image and Text

How can I do this with VBA?
--
Gary''s Student
gsnu200710




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I replicate a macro for each button on standard toolbar? Suzi Excel Discussion (Misc queries) 2 February 16th 07 11:25 PM
How do I duplicate a macro for a button on the Standard Toolbar? Suzi Excel Discussion (Misc queries) 1 February 13th 07 11:38 PM
How to get Research button on my standard toolbar? justpeeking89 Excel Discussion (Misc queries) 0 March 26th 06 11:50 PM
Fax Button on Standard Toolbar Bruce Excel Discussion (Misc queries) 1 April 19th 05 10:35 PM
Adding Macro Button on Standard Toolbar sebastienm Excel Programming 3 August 19th 04 03:59 AM


All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"