I created a outlook add-in using VSTO 2008. I didn't create a separate ribbon/group for this add-in. Instead VSTO automatically create the add-in button in the built-in Ribbon when Outlook starts.
Now how do I customize the tooltip of that add-in icon?
Here is the snippet to add label and icon for my add-in
[Microsoft.Office.Tools.Outlook.FormRegionMessageClass("IPM.Note.DougForm")]
[Microsoft.Office.Tools.Outlook.FormRegionName("Doug.Note.FormTest")]
public class QMemoRegionFactory : QRegionFactory, Microsoft.Office.Tools.Outlook.IFormRegionFactory
{
public DougFormTest()
{
this._Manifest.FormRegionName = "DougForm";
this._Manifest.Icons.Page = global::DougForm.OutlookAddin.Properties.Resources.DougIcon_big;
}
...
Thanks
Does you app generate any ribbon XML that you know of? The property names that can set tooltip text for buttons on a Ribbon are ScreenTip and SuperTip.
Alternatively, create your own custom ribbon XML and set the label, icon, and screentip to be whatever you want.
http://msdn.microsoft.com/en-us/library/aa942866(VS.80).aspx
Related
I have a ribbon xml where I want to add something similar as in the picture. I tried create a button and connect the menu to the button but I never got the arrow indication there is a underlying menu. I have no faith at all in that button is the correct element to use. Been googling for hours now and would be happy if anyone can send me in some kind of direction. There is no problem for me to add the element in the context menu, the problem is the dynamic menu linked to the first element.
The control type you're looking for is dynamicMenu
Here is the ribbon XML:
<dynamicMenu id="mycustomid" label="My custom label" getContent="GetMyCustomContent" />
And the code:
public string GetMyCustomContent(IRibbonControl control)
{
return "<menu xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
+ "<button id=\"anotherid\" label=\"another label\" onAction=\"DoWhatever\"/>"
+ "</menu>";
}
public string DoWhatever(IRibbonControl control)
{
}
I would like to enable select buttons on a custom ribbon after a user registers. I am having problems getting back to the ribbon load command.
Sub Button_Enabled(control as IRibbonControl)
BtnRegistration.Enabled = False
BtnSetup.Enabled = True
BtnBuild.Enabled = True
End sub
You can't modify ribbons directly, but you can set a getEnabled callback and return a boolean. Here is a C# example, should be simple enough to do the same in VB.
Ribbon XML:
<button idMso="ClearFormatting" getEnabled="HasRegistered" />
Code:
public bool HasRegistered()
{
return User.IsRegistered;
}
Once you have completed registration, invalidate the ribbon.
ribbon.Invalidate(); // all controls
ribbon.InvalidateControl(id); // only one control
I have created a custom task pane in VB.Net for Outlook using the Code given below and I would like to add more content to the header (image and a button) of the User Control instead of just the title. Is there a way I can achieve this?
myUserControl1 = New OutlookTaskPane
myUserControl1.TabStop = True
Dim width As Integer = myUserControl1.Width
myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "My Custom Task Pane")
myCustomTaskPane.Width = width
myCustomTaskPane.Visible = True
myCustomTaskPane.DockPositionRestrict = Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange
Let me know if there is any other way of achieving this please.
Thanks.
Unfortunately the TaskPane header is not customizable. Only Add-in Express supports similar customizations using their implementation of Advanced Form Regions (although only the header icon and header color can be changed and you can't add Windows Forms controls to it). Another option is to implement your own type of Task Pane so you have complete control over the UI; see https://code.msdn.microsoft.com/OlAdjacentWindows/.
I'm creating a COM add-in in VSTO for Ppt 2013 and am having a problem referencing the custom task pane in the active window.
My code is supposed to make the custom task pane visible for the active window only, however it currently runs for all document windows.
My code is:
For Each CTP As Microsoft.Office.Tools.CustomTaskPane In Globals.ThisAddIn.CustomTaskPanes
If CTP.Window Is Globals.ThisAddIn.Application.ActiveWindow Then
CTP.Visible = True
End If
Next
The taskpane is added to each new presentation created/ opened using the below code
AddIn_control1 = New AddIn_control
AddIn_taskpane = Me.CustomTaskPanes.add(AddIn_control1, "Add-in taskpane", Me.Application.ActiveWindow)
I conducted a little experiment and turns out CustomTaskPane.Window is always ActiveWindow. So to workaround it you can keep tracking of tackpanes in some dictionary:
Dictionary<CustomTaskPane, PowerPoint.Presentation> ctpDict = new Dictionary<CustomTaskPane, PowerPoint.Presentation>();
void Application_AfterNewPresentation(PowerPoint.Presentation Pres) {
AddIn_control AddIn_control1 = new AddIn_control();
CustomTaskPane AddIn_taskpane = this.CustomTaskPanes.Add(AddIn_control1, "Add-In Taskpane", this.Application.ActiveWindow);
ctpDict.Add(AddIn_taskpane, Pres);
}
and later you can use it:
if (cptDict[CTP] == Globals.ThisAddIn.Application.ActivePresentation) {
CTP.Visible = true;
}
I've created my own ribbon toolbar tab with a few buttons. I can add text and similar actions to the document I'm working on. Now I want to add a button that will save the document I'm working on without using the Word save button because I want to set some of the parameters.
Every example I found showed how to save a document that was started by my code (Dim MyDoc As New Word.Application) but when I use such syntax from the ribbon button - ActiveDocument is saying that there is no active document.
Any ideas?
ThisAddIn.vb contains:
Protected Overrides Function CreateRibbonExtensibilityObject() As _
Microsoft.Office.Core.IRibbonExtensibility
Return New MyRibbon()
End Function
MyRibbon.xml is very basic (taken from an MS sample)
<group id="ContentGroup" label="Content">
<button id="textButton" label="Insert Text"
screentip="Text" onAction="OnTextButton"
supertip="Inserts text at the cursor location."
/>
</group>
The new document that you have created is not going to be of type Word.Application. Your ribbon/add-in is running in a current Word.Application context.
If this is indeed what you are doing, you should be creating instances of Word.Document, and saving those.
What exactly is the code you are using to create the document, the ribbon, and save your changes?