Outlook 2007 Click a Button on the Ribbon through Code

N

n777krish

Hello all,

I need to insert a signature into an E-mail through code in Outlook
2007.

Does anyone know how I may be able to execute one of the Signatures
from the Signature menu on the Ribbon?

I know about the ExecuteMso method, but how do I get the idMso for the
signatures that appear on the menu when a new signature is inserted on
the Signature menu?

I am inserting a custom signature into the menu and and I need to
insert the signature into any new inspector when it opens up.

In Outlook 2003, i was able to Find the commandbars object for the
signature menu (using FindControl(ID)) and then loop through the
commandbars collection to check the captions of the buttons and execute
the button with my custom signature.

How would I be able to achieve this in Outlook 2007?

Thank you for any help in advance.

Regards,
Neil Goundar.
 
P

Patrick Schmid [MVP]

I think you are out of luck. Your better bet is to look into accessing
the signatures and their insertion from the Outlook object model. I
don't do anything with Outlook that goes beyond the ribbon, so I'll
leave the question whether this is possible up to another replier.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
N

n777krish

Hi Patrick,

Thank you for the reply. I have managed to solve this problem.

The CommandBars.FindControl that i was using in Outlook 2003 wasnt
working, but i observed that the commanbars collection is still
available in Outlook 2007.
From there it was just a matter of looping through the controls and
finding the one that I was looking for.

Could you confirm that I will not be able to click the Item on the
signature menu using ExecuteMso(idMso)?

Thank you for the help. I really appreciate it.

Regards,
Neil Goundar
I think you are out of luck. Your better bet is to look into accessing
the signatures and their insertion from the Outlook object model. I
don't do anything with Outlook that goes beyond the ribbon, so I'll
leave the question whether this is possible up to another replier.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

Hello all,

I need to insert a signature into an E-mail through code in Outlook
2007.

Does anyone know how I may be able to execute one of the Signatures
from the Signature menu on the Ribbon?

I know about the ExecuteMso method, but how do I get the idMso for the
signatures that appear on the menu when a new signature is inserted on
the Signature menu?

I am inserting a custom signature into the menu and and I need to
insert the signature into any new inspector when it opens up.

In Outlook 2003, i was able to Find the commandbars object for the
signature menu (using FindControl(ID)) and then loop through the
commandbars collection to check the captions of the buttons and execute
the button with my custom signature.

How would I be able to achieve this in Outlook 2007?

Thank you for any help in advance.

Regards,
Neil Goundar.
 
P

Patrick Schmid [MVP]

Could you confirm that I will not be able to click the Item on the
signature menu using ExecuteMso(idMso)?
There is no way to get the idMso...so, yes

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
Thank you for the help. I really appreciate it.

Regards,
Neil Goundar
I think you are out of luck. Your better bet is to look into accessing
the signatures and their insertion from the Outlook object model. I
don't do anything with Outlook that goes beyond the ribbon, so I'll
leave the question whether this is possible up to another replier.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

Hello all,

I need to insert a signature into an E-mail through code in Outlook
2007.

Does anyone know how I may be able to execute one of the Signatures
from the Signature menu on the Ribbon?

I know about the ExecuteMso method, but how do I get the idMso for the
signatures that appear on the menu when a new signature is inserted on
the Signature menu?

I am inserting a custom signature into the menu and and I need to
insert the signature into any new inspector when it opens up.

In Outlook 2003, i was able to Find the commandbars object for the
signature menu (using FindControl(ID)) and then loop through the
commandbars collection to check the captions of the buttons and execute
the button with my custom signature.

How would I be able to achieve this in Outlook 2007?

Thank you for any help in advance.

Regards,
Neil Goundar.
 
N

n777krish

Hello Patrick,

Thank you for the confirmation. That is what i thought.

On another note, since i am observing that commandbars is still
available for use, i am asking myself what is the guarantee that
microsoft does not remove the commandbars altogether in the future
since the Ribbon has come into the picture. I guess i'll make do with
the commanbars for now.

Regards,
Neil Goundar
Could you confirm that I will not be able to click the Item on the
signature menu using ExecuteMso(idMso)?
There is no way to get the idMso...so, yes

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
Thank you for the help. I really appreciate it.

Regards,
Neil Goundar
I think you are out of luck. Your better bet is to look into accessing
the signatures and their insertion from the Outlook object model. I
don't do anything with Outlook that goes beyond the ribbon, so I'll
leave the question whether this is possible up to another replier.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed


Hello all,

I need to insert a signature into an E-mail through code in Outlook
2007.

Does anyone know how I may be able to execute one of the Signatures
from the Signature menu on the Ribbon?

I know about the ExecuteMso method, but how do I get the idMso for the
signatures that appear on the menu when a new signature is inserted on
the Signature menu?

I am inserting a custom signature into the menu and and I need to
insert the signature into any new inspector when it opens up.

In Outlook 2003, i was able to Find the commandbars object for the
signature menu (using FindControl(ID)) and then loop through the
commandbars collection to check the captions of the buttons and execute
the button with my custom signature.

How would I be able to achieve this in Outlook 2007?

Thank you for any help in advance.

Regards,
Neil Goundar.
 
P

Patrick Schmid [MVP]

Who knows what Microsoft will do?

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

Hello Patrick,

Thank you for the confirmation. That is what i thought.

On another note, since i am observing that commandbars is still
available for use, i am asking myself what is the guarantee that
microsoft does not remove the commandbars altogether in the future
since the Ribbon has come into the picture. I guess i'll make do with
the commanbars for now.

Regards,
Neil Goundar
Could you confirm that I will not be able to click the Item on the
signature menu using ExecuteMso(idMso)?
There is no way to get the idMso...so, yes

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
Thank you for the help. I really appreciate it.

Regards,
Neil Goundar

Patrick Schmid [MVP] wrote:
I think you are out of luck. Your better bet is to look into accessing
the signatures and their insertion from the Outlook object model. I
don't do anything with Outlook that goes beyond the ribbon, so I'll
leave the question whether this is possible up to another replier.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed


Hello all,

I need to insert a signature into an E-mail through code in Outlook
2007.

Does anyone know how I may be able to execute one of the Signatures
from the Signature menu on the Ribbon?

I know about the ExecuteMso method, but how do I get the idMso for the
signatures that appear on the menu when a new signature is inserted on
the Signature menu?

I am inserting a custom signature into the menu and and I need to
insert the signature into any new inspector when it opens up.

In Outlook 2003, i was able to Find the commandbars object for the
signature menu (using FindControl(ID)) and then loop through the
commandbars collection to check the captions of the buttons and execute
the button with my custom signature.

How would I be able to achieve this in Outlook 2007?

Thank you for any help in advance.

Regards,
Neil Goundar.
 

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