Visual Studio Tools for Office (VSTO) version confusion - c#

Can someone enlight me about the version bindings between VSTO and the targeted office version?
I am using VS2008 with VSTO 3.0 to build and deploy an addin for Outlook 2003. I am totally confused about what is required on the target machine:
VSTO 2005 SE runtime or VSTO 3.0 runtime?
.NET Framework 2.0 or 3.5
Primary Interop Assemblies from Office 2003 (I guess)
In the end I need to tell the IT department of the customer how to deploy the addin using their own script based deloyment system. They do not want to have an MSI package.

You would need the VSTO 3.0 runtime for Office 2007 and the VSTO 2005 SE for Office 2003.
Wikipedia has a good table of what links with what.

Related

How to develop an excel 2010 VSTO on a machine with excel 2013?

I am developing an Excel 2010 VSTO project - my deploy machines have Excel2010 setup which can't be upgraded (production machines).
My development machine has Excel 2013 (again, due to IT I can't downgrade it to Excel 2010).
How can i develop such a project?
Trying to run the Excel 2010 VSTO project (from VS, either release or Debug) gives me an error message...
You cannot debug or run this project, because the required version of the Microsoft Office application is not installed.
and after clicking OK, i receive:
Unable to start debugging. Operation not supported. Unknown error: 0x80070057.
It is possible to develop a VSTO project against a later version of Office than that installed on the target systems. In order to do so, the project must base on .NET Framework 4 or later. Choose the project template for the version of Office installed on the development machine.
Set "Embed interop types" to True for all the Office libraries referenced in the project. This will make the object libraries version-independent.
It's also important to not use any functionality introduced after the earliest version of Office being targeted. If the code tries to use functionality introduced in Excel 2013, for example, this code cannot run in Excel 2010.
For more information see https://learn.microsoft.com/en-us/visualstudio/vsto/running-solutions-in-different-versions-of-microsoft-office?view=vs-2017 and https://learn.microsoft.com/en-us/visualstudio/vsto/designing-and-creating-office-solutions?view=vs-2017

Developing Outlook Add-In which Outlook Add-In version should I select in VS?

I am developing my first Outlook Add-In in C#. In Visual Studio I have the options to develop an "Outlook 2010 Add-in" or "Outlook 2013 Add-in" or probably an "Outlook 2016 Add-in".
This Add-In should work on one PC which runs currently Outlook 2010 but which I could upgrade to a newer version.
If I start to develop an "Outlook 2010 Add-in" will this also work in Outlook 2013 and 2016? Do I have to do something to make it work with different versions of Outlook?
My Add-In will check some details of the mails and depending on the details it will sort these mails. I guess that should work in all versions.
Is there a clear advantage of an 2013 or 2016 Add-In compared to 2010?
As mentioned in comments by #penleychan, targeting the latest version is a good thought. I did the same when I develop my VSTO addin. Most of the time I have used the common features of the Outlook and developed the addin with template version similar to the installed office (on my machine). Its easy to debug.
If the addin is going use specific feature(s) of a version of Office, then we should use that version template.
You may like to refer this link.
You can run your Office 2010 based solution in later Office versions. You just need to choose the right target .net version. Read more about that in the Running Solutions in Different Versions of Microsoft Office article.
Is there a clear advantage of an 2013 or 2016 Add-In compared to 2010?
The only benefit you get in that case - the PIAs version corresponding to the target Office version. That means you will get access to objects, methods, properties and events available in later Office versions. Anyway, at runtime you still can use the late-binding technology which allows accessing missed members at design-time. See Type.InvokeMember for more information.

Development of Office 2016 Add ons

I have already developed Oulook Add on using Visual Studio 2010 with VSTO
It works for OFFice 2007, 2010 and 2013
Now Office 2016 has been released. is the same application will work for 2016?
Is there any changes in VSTO and PIA Version for Office 2016? is those has been released?
if not when will be released? is there any web page to track the release?
If any, Whether i need to install those?
Appreciated for getting a development guidance in Office 2016
It doesn't matter what PIA version you use in the project. The add-in should work correctly until you use members introduced in newer Office versions. Read more about that in the Running Solutions in Different Versions of Microsoft Office article.
Note, you can use the late-binding technology for accessing properties, methods and events in newer Office versions even when using older PIAs. See Type.InvokeMember .
There is no separate installer for Office 2016 PIAs. You can install them as a part of Office 2016. See How to: Install Office Primary Interop Assemblies for more information.

Differences between Office Interop libraries

I am working on a C# .NET v4.0 application which includes generation of Word documents. The application uses the version 14.0.0.0 of the Microsoft Office Interop Word library.
My computer is running Office 2010 (Office14) and I am wondering what are the differences between the versions 14.0.0.0 and the 15.0.0.0 for the library?
Is there any obligation to use one or the other of these two libraries depending on which version of Office I am running?
If you link your app to the version 14.0.0.0 (Word 2010), it will work with Word 2013 (version 15) if you use the "Embed Interop Types" feature in Visual Studio.
If you link to 15.0.0.0, it will not work with Word 2010.
Linking to 15.0.0.0 will let you access to new functionality of 2013 if any.
If you don't need any automation of the application (Word) itself then I would recommand to use the offical Open XML SDK 2.5 for Microsoft Office to process any xlsx docx or pptx.
Download Open XML SDK
Update
I think it does not matter which version. More important is that your implementation works with the version that the customer has currently installed! Maybe or maybe not there could be some breaking changes between the interop interfaces between major versions.

Office development with Visual Studio 2010 (VSTO), things to consider

I'm still confused by the different versions of VSTO and in which way they are compatible to office 2007/2010. I know there is a nice table for comparisons on wikipedia, but I still don't get it. My focus lies on PowerPoint.
Okay, so I have the Visual Studio 2010 Professional Edition that provides two templates for PowerPoint: a 2007 Add-In template and a 2010 Add-In template. What exactly is the difference here, is it just the version of the underlying VSTO? Apart form that, is there a difference between VSTO 4.0 and VSTO 2010? Wikipedia uses both terms.
I want the Add-In to work with both PowerPoint 2007 and 2010. Should I chose the 2007 Add-in project type or the 2010 add-in project type?
Wikipedia says: "Office 2007 applications can also use the VSTO 2010 runtime"
and it also says
"VSTO solutions developed against newer Office versions will not work in older Office versions as they lack the necessary Primary Interop Assemblies (PIAs)".
Isn't that some kind of contradiction?
below image should be helpful
A VSTO project will work only with the selected version and later i.e. a 2007 add-in will work with Office 2007 and 2010, whereas a 2010 add-in will work with only 2010.
When deciding which version to choose for an add-in, choose the version of the oldest Office version you want to support.

Categories