A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

place button on ribbon for compose & read message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 19th 08, 01:34 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default place button on ribbon for compose & read message

hello

I've Outlook addin for office 2007 using VSTO SE.I need to add custom
buton on ribbon for existing mesage as well as for new message.
Currently I'm using below xml file

customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad"
ribbon
tabs
tab idMso="TabNewMailMessage"
group id="ClearV"
label="ClearV"

button id="Button1"
size="large"
label="Save And Send"
screentip="ClearV Save And Send"
onAction="OnButton1"
getEnabled="CallBackIsEnable"
imageMso="HappyFace"/
/group
/tab
/tabs
/ribbon
/customUI

rbnComposeMail.vb -
Public Function GetCustomUI(ByVal ribbonID As String) As String
Implements Office.IRibbonExtensibility.GetCustomUI
If ribbonID = "Microsoft.Outlook.Mail.Compose" Then
Return GetResourceText
("Outlook_Add_In.rbnComposeMail.xml")
'ElseIf ribbonID = "Microsoft.Outlook.Mail.Read" Then
' Return GetResourceText("Outlook_Add_In.rbnReadMail.xml")
End If

End Function

What extra I need to add to have my custom button on ribbon for both
new message & existing message?

I also want to disable/Enable this button when opening message
depending on some condition.I tried with Callback function but this
button gets enabled/disabled only for the first time thereafter it
remains as it is i.e. not enables/disables dynamically.

thanks
Ads
  #2  
Old November 19th 08, 02:20 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default place button on ribbon for compose & read message

You'll need to supply slightly different XML for a
"Microsoft.Outlook.Mail.Read" item, the tab is called "TabReadMessage" when
reading items.

To get your callbacks called again you need to call either the
InvalidateControl(controlID) method of the ribbon or the Invalidate()
method. Those can be called in the Inspector.Activate() event handler
depending on condition evaluation. InvalidateControl() fires the callbacks
for only that control, Invalidate() fires the callbacks for all of your
ribbon UI.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sd" wrote in message
...
hello

I've Outlook addin for office 2007 using VSTO SE.I need to add custom
buton on ribbon for existing mesage as well as for new message.
Currently I'm using below xml file

customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad"
ribbon
tabs
tab idMso="TabNewMailMessage"
group id="ClearV"
label="ClearV"

button id="Button1"
size="large"
label="Save And Send"
screentip="ClearV Save And Send"
onAction="OnButton1"
getEnabled="CallBackIsEnable"
imageMso="HappyFace"/
/group
/tab
/tabs
/ribbon
/customUI

rbnComposeMail.vb -
Public Function GetCustomUI(ByVal ribbonID As String) As String
Implements Office.IRibbonExtensibility.GetCustomUI
If ribbonID = "Microsoft.Outlook.Mail.Compose" Then
Return GetResourceText
("Outlook_Add_In.rbnComposeMail.xml")
'ElseIf ribbonID = "Microsoft.Outlook.Mail.Read" Then
' Return GetResourceText("Outlook_Add_In.rbnReadMail.xml")
End If

End Function

What extra I need to add to have my custom button on ribbon for both
new message & existing message?

I also want to disable/Enable this button when opening message
depending on some condition.I tried with Callback function but this
button gets enabled/disabled only for the first time thereafter it
remains as it is i.e. not enables/disables dynamically.

thanks


  #3  
Old November 20th 08, 01:57 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default place button on ribbon for compose & read message

Thanks Ken
I tried below xml
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad"
ribbon
tabs
tab idMso="TabReadMessage"
group id="ClearV2"
label="ClearV2"

button id="Button2"
size="large"
label="ClearV2"
screentip="ClearV2 tip"
onAction="OnButton2"
getEnabled="CallBackIsEnable"
imageMso="HappyFace"/
/group
/tab
/tabs
/ribbon
/customUI

I didn't get any error ,but my button was not displayed on Ribbon for
existing mail.What went wrong?
I'm using single vb file & 2 xml files -one for compose & other for
read.The vb file has below 2 functions
Public Function GetCustomUI(ByVal ribbonID As String) As String
Implements Office.IRibbonExtensibility.GetCustomUI
If ribbonID = "Microsoft.Outlook.Mail.Compose" Then
If gblnLicense = False Then Return Nothing
Return GetResourceText
("Clearv_Outlook_Add_In.rbnComposeMail.xml")
ElseIf ribbonID = "Microsoft.Outlook.Mail.Read" Then
Return GetResourceText
("Clearv_Outlook_Add_In.rbnReadMail.xml")
End If

End Function

Protected Overrides Function RequestService(ByVal serviceGuid As Guid)
As Object
If serviceGuid = GetType(Office.IRibbonExtensibility).GUID
Then
If ribbon Is Nothing Then
ribbon = New rbnComposeMail()
End If
Return ribbon
End If

Return MyBase.RequestService(serviceGuid)
End Function

Thanks again
  #4  
Old November 20th 08, 02:52 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default place button on ribbon for compose & read message

No idea offhand. The XML looks valid for read emails and uses correct
syntax.

Do you have the UI setting made to show any errors in your ribbon? Check
Tools, Options, Other tab, Advanced Options button, check the "Show add-in
user interface errors".

Also make sure you are getting the callback for that ribbon XML when you
initially open a mail item for reading.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sd" wrote in message
...
Thanks Ken
I tried below xml
customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad"
ribbon
tabs
tab idMso="TabReadMessage"
group id="ClearV2"
label="ClearV2"

button id="Button2"
size="large"
label="ClearV2"
screentip="ClearV2 tip"
onAction="OnButton2"
getEnabled="CallBackIsEnable"
imageMso="HappyFace"/
/group
/tab
/tabs
/ribbon
/customUI

I didn't get any error ,but my button was not displayed on Ribbon for
existing mail.What went wrong?
I'm using single vb file & 2 xml files -one for compose & other for
read.The vb file has below 2 functions
Public Function GetCustomUI(ByVal ribbonID As String) As String
Implements Office.IRibbonExtensibility.GetCustomUI
If ribbonID = "Microsoft.Outlook.Mail.Compose" Then
If gblnLicense = False Then Return Nothing
Return GetResourceText
("Clearv_Outlook_Add_In.rbnComposeMail.xml")
ElseIf ribbonID = "Microsoft.Outlook.Mail.Read" Then
Return GetResourceText
("Clearv_Outlook_Add_In.rbnReadMail.xml")
End If

End Function

Protected Overrides Function RequestService(ByVal serviceGuid As Guid)
As Object
If serviceGuid = GetType(Office.IRibbonExtensibility).GUID
Then
If ribbon Is Nothing Then
ribbon = New rbnComposeMail()
End If
Return ribbon
End If

Return MyBase.RequestService(serviceGuid)
End Function

Thanks again


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send button no longer on Message ribbon after reinstall Habu12 Outlook - General Queries 6 December 25th 08 10:21 AM
Add a control / button inside the group - Ribbon Bar Vela Add-ins for Outlook 3 January 25th 08 04:32 PM
Ribbon - Get position from clicked button Christian Havel Add-ins for Outlook 2 July 12th 07 08:20 AM
OLK2007 : Compose vs Read page actions Bill Billmire Outlook - Using Forms 4 January 16th 07 04:40 PM
Outlook 2007 Click a Button on the Ribbon through Code [email protected] Add-ins for Outlook 5 December 14th 06 08:04 PM


All times are GMT +1. The time now is 04:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.