I am developing 2 seperate Outlook Addins using the VSTO project type in Visual Studio 2022 (C# .Net 4.7.2) and wish them to appear under the same Ribbon UI.
Is this possible at all?
From the reading I've done I'm not sure it is.
You may need to use qualified id to identify the shared items (such as tabs) in your XML (and use the same "qualified id" in both add-ins). Note idQ instead of id:
<tab idQ="mycompany:SharedTab" label="Shared Tab">
I don't think Visual Studio ribbon designer supports this (?), so you may need to go with XML directly (click the "Extract Ribbon XML" and then follow the instructions to switch to plain XML ribbon definition)
Related
I'm using VSTO with Visual Studio 2015 and testing the add-in in Excel 2010. On the left side of my ribbon, there's a text showing "Custom Toolbars". How can I get rid of this text?
Solution: Thanks to #Cindy Meister insights, I went to the properties of the "OfficeRibbon" and clicked on "Tabs" properties. On "ControlIdType" (under "ControlId" option) I chose "Custom" instead of "Office" (which was the previous chosen option) and then the "Custom Toolbars" message disappeared.
This indicates that there is some other customization present besides your VSTO add-in. This customization probably comes from a pre-Ribbon version of Excel, where there were menus and toolbars. People and develpers could - and did - customize these quite frequently. When Office moved to the Ribbon UI in version 2007, these customizations were all dumped into the Add-ins tab on the Ribbon, which is shared.
As a developer you cannot control what appears in the Add-ins tab - it's designed to be shared.
If you don't want to share a tab then you should define your own, custom tab in the VSTO add-in. Probably, you're using the Ribbon Designer? In that case, right-click in the Designer in the Ribbon tab area. From the context menu, choose Add Ribbon Tab.
Any Ribbon tabs you create in this manner will be specific to your VSTO add-in. No one else will be able to add things to it, or execute your controls.
In Visual Studio (2013/2015/2017), the Document Outline window for C# files is always empty ("There are no items to show for the selected document.").
It seems that this functionality is not (not yet / no more) implemented.
But then, how do I view the structure of the file? Is there any extension which implements this functionality?
showing only the selected/opened file
show regions
move/rename members
show documentation
Using the Solution Explorer and Class View are NOT the solution.
In the old Visual Studio 2003, I did use a self written Add-In, because it was easy to read the structure. (There were also other tools but I cannot find them anymore). So I ask here which solution you know. :-)
EDIT: Similar question also found:
How to show code outline in Visual Studio?
UPDATE: After 10 years the feature has finally arrived in VS 2022
This feature has been added in Visual Studio 2022 17.4.0:
You can now easily view a file’s structure at a glance in the Document Outline window. The Document Outline window displays the symbol tree of the file in the editor helping you quickly navigate and edit project files. You can open Document Outline by going to View > Other Windows > Document Outline or by using the shortcut Ctrl+Alt+T.
Update: This feature was disabled in v17.4.4 for the following reason:
After we released 17.4, we found some significant performance problems with the C# implementation of Document Outline that we didn’t catch during preview usage. We’ve temporarily disabled the feature, and are spending more time working on it to address these issues. These changes are larger than we’d usually like to include in a revision release, and need more bake time, so 17.4.3 [sic] onwards & 17.5 will both ship with the feature disabled. I know this is disappointing, but we have it back in no time and enabled in a future VS update.
There is also CodeMaid which provides the same functionality as JetBrains Resharper, but is free.
The best solution I found at present is:
JetBrains ReSharper (v8.0+) has a File Structure window which shows the structure of the current file as tree (types/members) and regions are also supported.
If you don´t have ReSharper, you can´t miss the Productivity Power Tools, made by Microsoft itself.
There's a specific version for each of Visual Studio versions. More info on these links:
VS2013
VS2012
VS2010
They have a feature called Solution Navigator
Also, there's this one that seems very interesting for bring alot of cool customizations to Visual Studio IDE, called VSCommands. It's worth to checkout their website => http://vscommands.squaredinfinity.com/features
It helps you look at the nested structure of certain types of files, e.g. windows forms designer file, open a form designer you should see all controls on the form shown in nested structure in the document outline window.
I've created an application level add-in for Excel to automate some tasks. I used the VS2012 template Visual C# > Office > 2010 > Excel 2010 Add-In.
Rather than having an action pane open every time Excel does, I've opted to create a custom ribbon tab following these instructions:
http://msdn.microsoft.com/en-us/library/vstudio/bb386104.aspx
However, when I build my project, the tab does not display. I have verified the add-in is loading, and all of its features function properly, except the Ribbon. I created a simple form to test this, which loads as expected.
I then tried creating an Excel 2010 Workbook project. After adding the Ribbon (using the same steps as before) and building the project, it simply works; the ribbon tab appears as expected.
I've tried overriding ThisAddIn.CreateRibbonExtensibilityObject() to return my ribbon object, created via Globals.Factory.GetRibbonFactory().CreateRibbonManager. Again, no dice.
I'm at a loss now.
I also had this problem, where my VSTO ribbon wasn't being displayed.
Here's my solution, using Excel 2013 and VS2015.
What you need to do is:
Open the Ribbon Designer window
Select the RibbonTab object
In the "Properties" window, expand "ControlId" branch, and change the ControlIdType from "Office" to "Custom"
Ridiculous, hey ?
But, strangely, it works...
After much pain, I found that the Position property of the RibbonGroup must be Default.
I had this happen with using the xml ribbon developer tool. You have to add this code (or similar functionality into ThisAddIn.cs (or primary add in class)
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
return new Ribbon1();
}
Default tab's visible property value is False, set it to True.
I switched back to Visual Studio 2017 Community edition and it worked for me.
As an up-gradation process, I'd migrated my VSTO Add-Ins from VS 2017 to VS 2019.
When I compiled my Add-Ins on VS 2019 Community Add-Ins worked well for MS Word and Outlook, but MS Excel was not showing the Add-In (Ribbon)
Tried many suggestions but did not work. After switching back to VS 2017 Community it started working well.
Visual Studio Makes Class diagrams and if we open it in text editor program it is a simple XML. Surely we can generate that on runtime. But the problem is although you have visual studio to see the Class Diagram Generated but what solution is there if we want to deploy application where there is no Visual Studio Installed?
Is there any possibility or available plugin or library that can generate Class diagram or UML diagram from XML?
Can we somehow use Visual Studio Class Diagram to view it on runtime?
Not Sure but what if we generate xml on Back end and then if possible create Image (png or gif) using some builtin plugin and display that? (I am really not sure about this idea :()
I have seen NClass It is very good but a bit complex and it is not developed through XML.
I suggest to use PowerToys for Class Designer (http://modeling.codeplex.com). It improves the Class Designer and allows you to export diagrams to HTML. This way is easy to distribute to any machine.
As an alternative, you can take a different path with reflection, in this case you don't need the visual studio class diagram; the diagrams are generated by inspecting the requested types. I suggest to read the articles by Sacha Barber (http://www.codeproject.com/Articles/17823/100-Reflective-Class-Diagram-Creation-Tool and http://www.codeproject.com/Articles/207280/200-Reflective-Class-Diagram-Creation-Tool). Maybe you can customize his application.
In Visual Studio Enterprise 2017:
Quit Visual Studio if it is running
Start Visual Studio Installer
Click dropdown list "More" and select "Modify"
In section "Code tools", check the option for "Class Designer"
Click button: Modify
Result: now the Class Diagram should load from Solution Explorer as UML.
Using the new Visual Studio 2010 SDK developing against the MEF based editor structure there's a question:
How can I use the MEF editor interfaces to handle snippet behavior in IntelliSense? The ICompletionSession itself is not a problem (e.g. get the available snippets) rather filling the snippet, handling the subsequently expected actions like tab, enter behavior, text replacement, etc.
Is there any way to do that without a language service? Checking the built-in behavior in Visual Studio base editor implementation they built the MEF interfaces on top of a set of language service based objects.