I'm trying to develop an MS Office Addin in C# .Net and I don't have access to Visual Studio. Instead I'm using SharpDevelop as my IDE, (but my question is equally relevant to anyone developing using any other IDE or compiling from the command line...)
I've done a bit of searching for guides on how to develop AddIns, but they all seem to require Visual Studio and follow these steps:
Install the Interop Assemblies
Create a Visual Studio .Net Project (I'm unable to do this bit)
Extend the VS ThisAddIn template
What I've managed to do is to:
Install the Interop Assemblies
Create a C# empty SharpDevelop project
Add a GAC reference to Microsoft.Office.Interop.Outlook
Add a COM reference to Microsoft Office 12.0 Object Library
add the line using Outlook = Microsoft.Office.Interop.Outlook;
and the line using Office = Microsoft.Office.Core;
Look at some example code and realise that they all refer to VS templates and VSTO libraries (Microsoft.Office.Tools) which I don't have.
Where do I go from here? Is there a guide/tutorial I've missed, or can someone provide some pointers?
NetOffice (http://netoffice.codeplex.com or https://osdn.net/projects/netoffice/) is a great set of version-independent interop assemblies for Office. This is all you need to make add-ins using SharpDevelop, and the project has a bunch of tutorials and samples too, including some for Outlook.
If you're making an add-in for Excel using Excel-DNA (which you need to expose user-defined worksheet functions from .NET), NetOffice still gives you a complementary set of libraries for accessing the Excel COM automation interfaces from your Excel-DNA add-in, so they work together well.
For both NetOffice and Excel-DNA, you'll also be able to use the free Visual Studio Express editions (with some small tricks needed to get debugging working). Visual Studio Express does not include VSTO at all. SharpDevelop also has many more features than the Express editions, like built-in refactoring and VB.NET <-> C# translation tools, so there are good reasons to prefer SharpDevelop as your free IDE.
EDIT: I missed the reference to Outlook, my apolgies.
For Outlook, look here. Outlook Redemption is useful.
I'm not a Word Expert, but there are plenty of tutorials on the web.
For Excel I'd suggest you actually look at ExcelDNA
Plenty of SO questions on this topic. See Exposing .net methods as Excel functions? for example as additional advice on where to start and what your options are.
Related
I want to use C# to manage Excel read/write with the following method:
How to: Use COM Interop to Create an Excel Spreadsheet (C# Programming Guide)
Before using COM Interop API , most articles said that I should install Office Developer Tools . so ,is it possible to use Visual studio Express 2017 to fulfill its demands.If not, is there another way to manage excel read/write through C#? thanks!
I have a Excel addin written in VBA which iterates through used range of a sheet and manipulates cell values. Its a simple addin but now user requirements have changed and I want to develop it in C# in Visual studio. For this purpose i was looking into VSTO but as far as i can understand in visual studio you can develop addin for a single version of excel. I have to give support for excel 2010 and excel 2013. What should I do to overcome this issue. which visual studio version i should use?
Any version of Visual Studio from 2010 to the present should be able to create VSTO Add-ins for Excel 2010. From VS 2012 onwards, also for Office 2013. Which set of templates you see in the later versions depends on 1) the version of Office installed and 2) the version of the .NET Framework selected when creating the project (4.0 for 2010; 4.5 for later). More information can be found on this page: https://blogs.msdn.microsoft.com/vsto/2013/03/06/office-developer-tools-for-visual-studio-2012-now-available-with-office-2013-and-net-framework-4-5-support/
Note that you should have only one version of Office installed in the development environment.
If possible, you should develop the Add-in for Excel 2010. An Add-in developed for an older version will run for a newer version, without you needing to do anything in addition - assuming Microsoft hasn't made changes to the parts of the object model you use which will "break" it. Since Microsoft pays special attention to backwards compatibility, this is usually not a problem, but thorough testing is important. It is not necessary to re-build or otherwise change the installation for installing to a newer version of Office.
One important reason to develop against the older version is that forwards compatibility is not supported. In other words, if you should use something in the newer version that's not present in the older one, that code will fail.
Also, the VSTO functionality will automatically "re-map" references made to an older set of PIAs to the newer ones for a newer version of Office. The reverse is not the case.
If for some reason it's not possible to program using the older version, as long as you have the .NET Framework 4.0 (or later) you can use the "Embed Interop types" property of a Reference to embed the PIA information in your project, so that it travels with your solution instead of referencing the PIAs installed in the GAC and makes them version independent. This is fine, in theory, but requires very thorough and careful testing since - besides the forwards compatibility problem - the actual information embedded does not always behave correctly.
you need to install visual studio 2013 for VSTO version 13 that support Excel 2013, but you can support excel 2010 by creating the installer file from the application. and there is no other way to support two different version from the code base at the same time
Thanks
I have an addin that is compatible with Outlook 2003 - 2013 by using the various versions of VSTO.
It seems that the majority of small businesses will have the Click To Release version, which is not compatible with addins.
Is there a way to make an addin compatible with 2013 C2R, or does it need to be rewritten to be an "App" using Napa?
C2R Office installation load COM addins in exactly the same way as the regular version of the Office, there is nothing you need to do.
What is the exact problem that you are running into?
I just created a VSTO Add-In for Office 2010. How how do I know which pre-requisites I need and whether or not my add-in would work for both 2010 and 2007 or just 2010? I'm confused why this seems obvious based on the lack of documentation on this topic. During compilation it tells you if there is a problem if you're building for instance on .NET Client profile instead of the full .NET but for all the other prerequisites I don't know how to tell. Do I need for instance the Visual Studio for Office 2010 Runtime and the Interlop Assemblies?
This might be of interest:
https://stackoverflow.com/a/4411365/1373170
and https://stackoverflow.com/a/1596868/1373170
If you are on .NET 4, you don't need to ship PIA anymore, if you use embedded interop assemblies.
The VSTO Runtime would still be required I believe.
I am writing a plug for Visual Studio 2005/2008. I want gain access the controls in the following picture:alt text http://img145.imageshack.us/img145/2773/82813838.jpg
How do it ?
Intellisense in Visual Studio 2008 also works for javascript source code. You don't need an extra add-in for that but rather just documentation file for your javascript. It will also work for Prototype library but you won't have any documentation nor will it work in chaining multiple functions, because it doesn't know return types.
Anyway, this should be a nice start (since it's for 1.6.0 RC1 version):
Prototype VS2008 Intellisense