Copy or Creating a Default word control

R

Roby E Martins

HI,

I´m Roby E Martins, vb developer. I´m working with
office 2000.

I´m trying to create my commandbar in the word with,
for example, the "FONT COLOR" popup button on it.
I´m creating using the ID number, because I think if I
copy the control from the "formatting" Commandbar, in some
computers will not work, because some user´s can customize
the commandbar "Formatting" and remove the "FONT COLOR"
from it.
So, I create the control, but the popup menu comes
empty.
How can I make my new control look´s identical to the
control in "Formatting" commandbar?
This happens not only with "FONT COLOR", but
with "Underline", "BORDER" , "Back Color" and others too.

Thank you,
Roby E Martins
 
J

Jezebel

In Customize mode, right-click the original button, select copy button
image, right-click the target, select paste.

Not sure what you're getting at with the ID number -- commandbars are
user-editable, however you create the controls.



HI,

I´m Roby E Martins, vb developer. I´m working with
office 2000.

I´m trying to create my commandbar in the word with,
for example, the "FONT COLOR" popup button on it.
I´m creating using the ID number, because I think if I
copy the control from the "formatting" Commandbar, in some
computers will not work, because some user´s can customize
the commandbar "Formatting" and remove the "FONT COLOR"
from it.
So, I create the control, but the popup menu comes
empty.
How can I make my new control look´s identical to the
control in "Formatting" commandbar?
This happens not only with "FONT COLOR", but
with "Underline", "BORDER" , "Back Color" and others too.

Thank you,
Roby E Martins
 
R

Roby E Martins

-----Original Message-----
In Customize mode, right-click the original button, select copy button
image, right-click the target, select paste.

Ok, but if I start a word changed by the user. The user
remove the button in the CommandBar. Then I can´t copy
something that isn´t there.
Is There any other way to copy it?
Not sure what you're getting at with the ID number -- commandbars are
user-editable, however you create the controls.

Using the ID I got the Caption, Description Image. But
the Popup control are missing. this is the real problem.

Thank you,
ROBY E MARTINS
 
J

Jezebel

If it's a built-in then it's always there, even if not visible.
Alternatively, use the template or add-in that contains your macro.


-----Original Message-----
In Customize mode, right-click the original button, select copy button
image, right-click the target, select paste.

Ok, but if I start a word changed by the user. The user
remove the button in the CommandBar. Then I can´t copy
something that isn´t there.
Is There any other way to copy it?
Not sure what you're getting at with the ID number -- commandbars are
user-editable, however you create the controls.

Using the ID I got the Caption, Description Image. But
the Popup control are missing. this is the real problem.

Thank you,
ROBY E MARTINS
 
G

Guest

-----Original Message-----
If it's a built-in then it's always there, even if not
visible.

Where? I don´t know from where I have to copy this
controls. Some of them are not in the default commandbar.
But the users can add it. Like "UNDERLINE" popup.
 
J

Jezebel

The CommandBars object model is not one of Microsoft's better creations. As
object models go, it's a veritable pigs' breakfast. But everything is there;
you just need to persevere. Bear in mind that the CommandBars system is part
of Office, not Word, so you need to explore the MSOx.dll to find all the
bits.

Not sure what you mean by the 'default' commandbar. There are 20-some
built-in commandbars in Word, none of which is called 'default'. Each of
those has a CommandBarControls collection; and some of those controls have
their own controls collection. My method to distribute buttons is to add my
own commandbar to the template I distribute: this commandbar is not actually
used by the user: it just holds all the button images I need to copy.

-- You can use code like this to get a list of the CommandBars

Sub ListBars()

Dim pBar As Office.CommandBar

For Each pBar In CommandBars
Debug.Print pBar.Name
Next

End Sub




-----Original Message-----
If it's a built-in then it's always there, even if not
visible.

Where? I don´t know from where I have to copy this
controls. Some of them are not in the default commandbar.
But the users can add it. Like "UNDERLINE" popup.
 
R

Roby E Martins

I think we are talking about diferent things.
There is a button popup with the ID 3962 ( the
UnderLine popup I mentioned before).
I only need to copy this control, that is not located
in any commandbar, to my commandbar.
I can create a button using this ID, but the popup will
come with no controls in it.

Thank you again,
Roby E Martins
 
J

Jezebel

Yes, I think we must be talking about different things. There is no
commandbar control with ID 3962 in my copy of Office 2000. (You can use the
FindControls method to check.) The underline control has ID 115.


I think we are talking about diferent things.
There is a button popup with the ID 3962 ( the
UnderLine popup I mentioned before).
I only need to copy this control, that is not located
in any commandbar, to my commandbar.
I can create a button using this ID, but the popup will
come with no controls in it.

Thank you again,
Roby E Martins
 
T

Thomas Winter

Sorry for getting involved in the middle of this, but why can't you just
create your command bar by hand, interactively in Word, and copy the
appropriate control onto the command bar then. I asume it should remain
there for other users. You can then use VBA code to modify the command bar
in whatever way you need.

-Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top