I am trying to revamp lots of word templates from VBA (.dotm) to C# using VSTO & Visual Studio.
My question is if its possible to deploy multiple word templates with one VSTO installation or bundle so the user does not has to install VSTO for every template?
There are two kinds of VSTO add-ins for Word - application-level and document-level add-ins. The Application level add-ins are not specific or linked to any document, they are installed for the application, not document. So, if you consider creating an application-level add-in for Word you may include any number of templates to the add-in. And there is no need to create a document-level add-in for each of them. See Walkthrough: Create your first VSTO Add-in for Word for more information.
For document-level add-ins, see Walkthrough: Create your first document-level customization for Word.
Related
I want to build an excel add-in which is application level. I followed the instructions to create a project on MSDN.
I don't want to create a COM add-in, I want an Excel plugin. The plugin we create as .xlam file and code it in VBA.
Please suggest me what to do. How to deploy the .vsto file and patch up with the .xlam file?
A VSTO Office add-in is a COM add-in by definition. That is how Microsoft implemented it. They have built a bridge from .NET to the native Microsoft Office code using COM.
If you want an XLAM add-in, as you say, you need to go through this reference, which doesn't involve creating a Visual Studio VSTO project.
I want to create a single VSTO addin for all MS office components.
So far I have get individual addins for each component like Word Addin,Excel Addin etc..
But I want to create a single addin for all Ms Office components and also in single deployment it will be added in all ms office components.
I have to add a custom task pane and a ribbon tab in each ms office component,so rather than duplicating the task in each individual addin project,I want a single addin.
VSTO doesn't support creating multi-host add-ins. You need to develop a separate add-in for each Office application. An alternative way is to develop a shared add-in.
You may also consider using Add-in Express instead. It allows to to create one Visual Studio project that supports all versions (2000, XP, 2003, 2007, 2010 and 2013) and editions (Student, Home, Professional etc.) of Microsoft Office and target multiple applications in the Microsoft Office suite (Outlook, Word, Excel, PowerPoint and other apps.)
i've created an word 2010 Add-in with the VS 2012 word Add-in template and ribbon designer component.
It is possible to use this plugin in other office products, like Excel or Outlook if I add the other interop dlls?
How can I differ which office product (word, excel or outlook) actually is used to run differnt code segments in the add-in?
Or must I create for each an own plugin with own ribbon!?
Please give me some hints.
Regards
If you link statically to the Office Interop assemblies, then you will need to build a different version for each Office version you plan to support. A much better alternative I would recommend you investigate is to use NetOffice, which provides the Office API in a version-independent form:
http://netoffice.codeplex.com/
How can I define a custom menu (part of an addin) programmatically for Word 2003 and Word 2007 with the Visual Studio Tool for Office respectively .NET? The problem ist, that in Office 2003 there are no ribbons and on the other hand in Office 2007 there are no toolbars. So what is the "lowest common denominator" regarding menus or the user interface in general between these 2 Office versions?
The lowest common denominator is that you can create menus in all versions. They show up fine in the pre-ribbon versions of Office, but they appear on an special tab named Add-ins. This tab only exists so that legacy code that uses old style command bars can still present UI in modern versions of Office that use the ribbon.
So, if you use command bar code to add menu items, those menus will indeed appear in all versions of Office. But this truly is the lowest common denominator. The user experience is poor on ribbon versions of Office.
The normal solution that add-in authors take is to arrange that the add-in switches behaviour according to the version of its host. So, if the add-in detects that it is on Office 2003 or earlier, use command bars. Otherwise, add a ribbon interface.
I need to create a custom Excel 2010 ribbon (document level).
I have no Visual Studio, but have Visual C# 2010 express
If this is possible, please give me some gudelines.
You can customize the ribbon in Excel or any Office application without using Visual Studio, instead using a combination of XML and VBA.
A good starting-point for customizing the ribbon: http://msdn.microsoft.com/en-us/library/office/aa338202%28v=office.12%29.aspx (The title says Office 2007 but it will work for Office 2010 as well)
There is a free application that helps you design and validate the XML to modify the ribbon called the "Custom UI Editor For Microsoft Office": http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2006/05/25/customuieditor.aspx
Actually you have Visual Studio, but Express Edition and it shouldn't make any difference at this point ;)
I don't get your point about "Excel 2010 ribbon". I think that this is handled by Excel 2010 and it's part of User Interface of Office 2010, so if you open any Excel file in 2010 version you'll get ribbons. You can customize Office 2010 Ribbon and creating Excel files can be done in a lot of different ways i.e. using OpenXML, Microsoft Office Interop. Each has advantages and disadvantages.