How to create button in multiple lines?

Status
Not open for further replies.
R

ryotyankou

I create a toolbar with 8 buttons, in outlook2007 it display in one row, it

is too long, how to set them in two rows, 4 buttons each row? which property

or interface etc. And i don't want to make outlook2003 not work, in

outlook2003, 2003 seems all button is in one row, Thank you.


 
You would need to create two separate toolbars. There are no rows in

toolbars (CommandBar objects).

If this is for Inspector UI you really should be handling the ribbon instead

of creating button/toolbar UI if you discover at runtime that the code is

running under Outlook 2007.

"ryotyankou " <u48591@uwe> wrote in message

news:97a1d8319fd34@uwe...
> I create a toolbar with 8 buttons, in outlook2007 it display in one row, it
> is too long, how to set them in two rows, 4 buttons each row? which
> property
> or interface etc. And i don't want to make outlook2003 not work, in
> outlook2003, 2003 seems all button is in one row, Thank you.

> >
>
>
 
After see some document I know what a ribbon is, forgive my innocent.

Now i have a question, since my codes wrote under outlook2003 which not

support ribbon. But i want to maintain only one project. What should i do

with IRibbonExtensibility interface, when outlook is 2007 it can take effect,

and 2003 ignore the interface?
- wrote:
> You would need to create two separate toolbars. There are no rows in
> toolbars (CommandBar objects).

> If this is for Inspector UI you really should be handling the ribbon instead
> of creating button/toolbar UI if you discover at runtime that the code is
> running under Outlook 2007.
>
> >I create a toolbar with 8 buttons, in outlook2007 it display in one row, it
> > is too long, how to set them in two rows, 4 buttons each row? which
> > property
> > or interface etc. And i don't want to make outlook2003 not work, in
> > outlook2003, 2003 seems all button is in one row, Thank you.



 
One more question, how to monitor other existing button click event on ribbon?

and after i create my button and then click on my button, in my click button

produre, how could i do a click on other existing button such as sign button

or encrypt button?
- wrote:
> You would need to create two separate toolbars. There are no rows in
> toolbars (CommandBar objects).

> If this is for Inspector UI you really should be handling the ribbon instead
> of creating button/toolbar UI if you discover at runtime that the code is
> running under Outlook 2007.
>
> >I create a toolbar with 8 buttons, in outlook2007 it display in one row, it
> > is too long, how to set them in two rows, 4 buttons each row? which
> > property
> > or interface etc. And i don't want to make outlook2003 not work, in
> > outlook2003, 2003 seems all button is in one row, Thank you.


 
Search for Andrew Whitechapel's blog at MSDN, he's a member of the VSTO

team. He posted how to handle the callbacks for the ribbon without having to

explicitly having an Office 2007 reference.

You also should be downloading and studying the Ribbon XML and documentation

and the Outlook 2007 sample addins all available for download at the Office

Development Web site at MSDN so you understand how to do what you need to do

with the ribbon.

"ryotyankou " <u48591@uwe> wrote in message

news:97b75c9f5226b@uwe...
> After see some document I know what a ribbon is, forgive my innocent.
> Now i have a question, since my codes wrote under outlook2003 which not
> support ribbon. But i want to maintain only one project. What should i do
> with IRibbonExtensibility interface, when outlook is 2007 it can take
> effect,
> and 2003 ignore the interface?
 
Office 2007 has a CommandBars.ExecuteMso() method that you call with the

idMso of the control you want to execute. If you are only referencing the

Office 2003 object library then you can call that method using reflection.

"ryotyankou " <u48591@uwe> wrote in message

news:97bb0698c3f7d@uwe...
> One more question, how to monitor other existing button click event on
> ribbon?
> and after i create my button and then click on my button, in my click
> button
> produre, how could i do a click on other existing button such as sign
> button
> or encrypt button?
 
Thank you for reply, Ken. Ribbon is quite strange to me, i'm trying at my

best, now two questions, 1.)How could i load two different xml file for two

conditions, one for editor mode, another for viewer mode, since GetCustemUI

only initialize for once after first NewInspector event.

2.)How could i monitor click event on other button(not created by me) if user

click on it. Should i found the specified button and get its CommandBarButton

or If i can get its ribbon interface and make something on it?

These are my understanding, may be it is misunderstand, if so, could you pls

help me out? thanks.
- wrote:
> Office 2007 has a CommandBars.ExecuteMso() method that you call with the
> idMso of the control you want to execute. If you are only referencing the
> Office 2003 object library then you can call that method using reflection.
>
> > One more question, how to monitor other existing button click event on
> > ribbon?

> [quoted text clipped - 3 lines]
> > button
> > or encrypt button?



 
If you look at the ribbon stuff I told you to look at you will see that

there are separate GetCustomUI() callbacks for messages in create and read

modes. So you can supply different XML for each type. One provides

"Microsoft.Outlook.Mail.Read" and the other provides

""Microsoft.Outlook.Mail.Compose" as the RibbonID argument.

There is no way to get or handle any callbacks for any custom ribbon control

not created by you. If that's what you want forget about it.

If what you want is to handle clicks on built-in ribbon controls that is

repurposing the controls, and there are articles on how to do that. Just

google for "repurpose ribbon controls".

Many of these questions are already answered if you look at the materials

that are available.

"ryotyankou " <u48591@uwe> wrote in message

news:97c77a8491a1a@uwe...
> Thank you for reply, Ken. Ribbon is quite strange to me, i'm trying at my
> best, now two questions, 1.)How could i load two different xml file for
> two
> conditions, one for editor mode, another for viewer mode, since
> GetCustemUI
> only initialize for once after first NewInspector event.
> 2.)How could i monitor click event on other button(not created by me) if
> user
> click on it. Should i found the specified button and get its
> CommandBarButton
> or If i can get its ribbon interface and make something on it?
> These are my understanding, may be it is misunderstand, if so, could you
> pls
> help me out? thanks.
 
Thank you for the reply, Ken. I got the answers for my question. But that's

not the end, i still have a question:

How to change control image by code, in getImage callback? How about multiple

inspector?

As what i understand, we can call IRibbonUI::InvalidateControl("myctrlid")

make the control initialize and get in callback function again, then set the

image we wanted. But in multiple inspector, all control id are "myctrlid", if

i call InvalidateControl, all inspector's getImage callback will fire, i

don't know how to process it. I checked the IRibbonControl::GetContext, and

compare it with active inspector, if equal, set the new image, if not, return

old one, question is that how to know which is the old one, If i open 10

inspector, should there be 9 old images? How to process? I'm quite confused.
- wrote:
> If you look at the ribbon stuff I told you to look at you will see that
> there are separate GetCustomUI() callbacks for messages in create and read
> modes. So you can supply different XML for each type. One provides
> "Microsoft.Outlook.Mail.Read" and the other provides
> ""Microsoft.Outlook.Mail.Compose" as the RibbonID argument.

> There is no way to get or handle any callbacks for any custom ribbon control
> not created by you. If that's what you want forget about it.

> If what you want is to handle clicks on built-in ribbon controls that is
> repurposing the controls, and there are articles on how to do that. Just
> google for "repurpose ribbon controls".

> Many of these questions are already answered if you look at the materials
> that are available.
>
> > Thank you for reply, Ken. Ribbon is quite strange to me, i'm trying at my
> > best, now two questions, 1.)How could i load two different xml file for

> [quoted text clipped - 10 lines]
> > pls
> > help me out? thanks.



 
Hi, ken, could i be able to click a build-in button by code, for instance,

when user click on my button, then i want to click a build-in button by code

in my button callback function, could i do it, if so, how?
- wrote:
> If you look at the ribbon stuff I told you to look at you will see that
> there are separate GetCustomUI() callbacks for messages in create and read
> modes. So you can supply different XML for each type. One provides
> "Microsoft.Outlook.Mail.Read" and the other provides
> ""Microsoft.Outlook.Mail.Compose" as the RibbonID argument.

> There is no way to get or handle any callbacks for any custom ribbon control
> not created by you. If that's what you want forget about it.

> If what you want is to handle clicks on built-in ribbon controls that is
> repurposing the controls, and there are articles on how to do that. Just
> google for "repurpose ribbon controls".

> Many of these questions are already answered if you look at the materials
> that are available.
>
> > Thank you for reply, Ken. Ribbon is quite strange to me, i'm trying at my
> > best, now two questions, 1.)How could i load two different xml file for

> [quoted text clipped - 10 lines]
> > pls
> > help me out? thanks.



 
How you would do that depends on whether it's an Explorer with

CommandBarButton's to click or ribbon controls in Inspectors.

For a CommandBarButton you find it in the CommandBar where it's shown and

then call its Execute() method.

For a ribbon control you need its idMso, which you can get from the ribbon

XML schema, then you get the Inspector.CommandBars object and call the

ExecuteMso() method, passing the ribbon control's idMso.

"ryotyankou " <u48591@uwe> wrote in message

news:97f9bba0a6714@uwe...
> Hi, ken, could i be able to click a build-in button by code, for instance,
> when user click on my button, then i want to click a build-in button by
> code
> in my button callback function, could i do it, if so, how?
 
When multiple Inspectors (and Explorers) are open, or to handle that

situation you use a wrapper class and keep all wrapper class instances alive

in a collection of some sort (list, sorted list, hashtable, etc.). The

wrapper class has event handlers in it for the Inspector and item in the

Inspector, such as Activate() and Close(). It also exposes the Inspector and

CurrentItem as public properties available to the outside.

In a callback such as getImage() you would iterate the Inspectors wrapper

collection and get the Inspector exposed by each wrapper class instance,

then you compare that Inspector with what was passed in the callback.

Outlook 2007 makes that easy by allowing a direct comparison using == in c#

or Is in VB.NET.

When you find your Inspector you then can supply an image for it based on

the current setup and configuration.

I have some wrapper class examples on my Web site as part of the addin

sample templates there. I have templates for C#, VB.NET and VB6. You can

find them at http://www.slovaktech.com/outlook_2007_templates.htm. There are

also other sample templates available at the outlookcode.com Web site.

"ryotyankou " <u48591@uwe> wrote in message

news:97f80880fb8c2@uwe...
> Thank you for the reply, Ken. I got the answers for my question. But
> that's
> not the end, i still have a question:
> How to change control image by code, in getImage callback? How about
> multiple
> inspector?
> As what i understand, we can call IRibbonUI::InvalidateControl("myctrlid")
> make the control initialize and get in callback function again, then set
> the
> image we wanted. But in multiple inspector, all control id are "myctrlid",
> if
> i call InvalidateControl, all inspector's getImage callback will fire, i
> don't know how to process it. I checked the IRibbonControl::GetContext,
> and
> compare it with active inspector, if equal, set the new image, if not,
> return
> old one, question is that how to know which is the old one, If i open 10
> inspector, should there be 9 old images? How to process? I'm quite
> confused.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J Want to create a button on the nav bar (module add-in) to run code Outlook VBA and Custom Forms 2
B How to create a button that sorts and selects the most recent message with ONE click Using Outlook 2
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
P Possibility to create a calendar button "remaining week"??? Using Outlook 3
S Create a custom "Send" Button Outlook VBA and Custom Forms 3
C create a button go to linked account on a task form BCM (Business Contact Manager) 3
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
B Modify VBA to create a RULE to block multiple messages Outlook VBA and Custom Forms 0
J PSA: How to create custom keyboard shortcut for "Paste Unformatted Text" in Outlook on Windows Outlook VBA and Custom Forms 1
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1
Wotme create email only data file Using Outlook 1
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
Commodore Any way to create "from-only" account on Outlook 2021? Using Outlook 1
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
N Can't create NEW GROUP and add/remove a member from existing Group in Outlook Using Outlook 1
NVDon Create new Move To Folder list Outlook VBA and Custom Forms 0
C Create Meeting With Custom Form Outlook VBA and Custom Forms 2
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
G Create ordinal numbers for birthday Outlook VBA and Custom Forms 2
O Outlook 365 - How to create / copy a new contact from an existing one? Using Outlook 5
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
A How to create fixed signatures for aliases that process through GMAIL? Outlook VBA and Custom Forms 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
B Can I create a local PST file for SPAM on a drive that is usually disconnected? Using Outlook 3
Chiba Create an appointment for all the members Outlook VBA and Custom Forms 1
S Create a clickable custom column field Outlook VBA and Custom Forms 0
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
L automaticaly create a teams meeting with a sync Using Outlook 0
D Can Exchange Admin Center create a pst for users email/contacts/calendar? Exchange Server Administration 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
F How to create phone number as links in notes of Contacts Using Outlook 2
Nessa Can't create new appointment Using Outlook 1
A Create date folder and move messages daily Outlook VBA and Custom Forms 1
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
O Multiple email accounts - hesitate to create a new profile Using Outlook 3
G Can't create Folder Groups in Outlook 2013 Using Outlook 0
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
F Delete/create/reset Exchange mailbox on Outlook.com Using Outlook.com accounts in Outlook 3
R Can not create folder to store specific emails in in Outlook for Mac Using Outlook 1
W Create Search Folder excluding Specific Email Addresses Using Outlook 5
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
JackBlack What tools do you use to create the signature for email? Using Outlook 3
Rupert Dragwater How to create a new email with @outlook.com Using Outlook.com accounts in Outlook 32
F Should a new email account also create new contacts Using Outlook 2
D create an html table in outlook custom form 2010 using vba in MsAccess Outlook VBA and Custom Forms 7
R Outlook add-in to create new contact from an email. Using Outlook 0
Q Script to create a pst file for Archiving Using Outlook 1

Similar threads

Back
Top