Write outlook 2007 add-in with visual studio 2013 - outlook-addin

Is it posssible to write outlook 2007 add-in using visual studio 2013 in C#. Thanks for help.

According to Microsoft, the latest version of Visual Studio that can create an addin for Office 2007 is Visual Studio 2010.
If you want to develop an Office 2010 addin etc., you can use Visual Studio 2010 or Visual Studio 2012.
If you want to develop an Office 2013 addin etc., you can only use Visual Studio 2013.
Office Development and Visual Studio

This probably a bit late, but just for future reference: Running Solutions in Different Versions of Microsoft Office

There's no out of the box template for Office 2007 in Visual Studio 2013, but the addin will run fine in Office 2007.
Your project will have the Object Model for Office 2013 so while you can use it in previous versions of Office, you need to be careful not to call methods that aren't available in the earlier versions. For example in Outlook 2013 there is an inline reply so if you try to call that method in Outlook 2007 it will throw an exception.
If you're just looking to use the newer Visual Studio IDE for Office 2007 development then you can remove the 2013 Office references and add the 2007 references and you won't see any new methods as outlined above.
Edit: Not that you'd want to do this, but if you wanted to use the newer object model from 2007 without pulling in the interop library for 2013 you can actually call those newer methods dynamically and specify non existing delegate types by using Delegate.CreateDelegate, if anything it's pretty neat.

Related

visual studio 2015 office 2007

my job is to maintain a word-addin, created many years ago, developed by many young programmers like me ;) the addin works fine and there are only a few and easy changes to do from time to time, so my task is to bring the development environment up to date.
The addin was handed over to me as an visual basic project with Visual Studio 2005(in XP-Mode) and a .dot-file
Now I wanted to use Visual Studio 2015, but when I tried to migrate the project there is an error which says the word-version i'm using is not supported by VS2015 and tells me to use Office 2010 minimum. The problem is, my company just uses Office(Word) 2007.
So how can i get VS2015 to migrate the project properly and to use word 2007? Or do I have to use 2010? I read 2010-addins can be used in 2007 and via versa, so this should not be the problem.
Following software is installed:
Microsoft .NET Framework 2.0 SP2
Microsoft .NET Framework 3.0 SP2
Microsoft .NET Framework 3.5 SP1
Microsoft .NET Framework 4/4.5/4.5.1/4.5.2/4.6
Microsoft Office Developer Tools for Visual Studio 2015
Microsoft Visual Studio 2010 Tools for Office Runtime
Visual Studio 2005 Tools for Office Second Edition Runtime
Visual Studio 2015 Community
Microsoft Office Word 2007
thanks for help :) and please excuse my bad english
The short answer is that you cannot use Visual Studio 2015 to open the original project, but you can recreate the code in a new project that will still work with Office 2007:
https://msdn.microsoft.com/en-us/library/bb772080.aspx

How to install visual studio tools for office?

How to install visual studio tools for office runtime in order that I can use Word 2010 Document template in Visual Basic 2010?
in Solution Explorer , Right Click on References >> Add References >>Microsoft.Office.Interop
use in your form :
Imports Microsoft.Office.Interop
or find on google Interop.MSDACS.dll an copy to assembly folder,
and Excel example : http://www.dotnetperls.com/excel-vbnet
and for Word ex: clic link here for Word
How to install visual studio tools for office runtime in order that I can use Word 2010 Document template in Visual Basic 2010?
See Visual Studio 2010 Tools for Office Runtime.
VSTO is a part of Visual Studio. It is included in paid editions only. The Express editions are not supported (except the Community edition of Visual Studio 2013).
Typically you need to include the VSTO runtime as a prerequsite to the add-in installer. See Publishing an Office Solution by Using Windows Installer for more information.
If you're using Visual Studio 2015 Community, go to Office Developer Tools
and click "Get Office Developer Tools", which takes you to:
http://aka.ms/getlatestofficedevtools
https://www.visualstudio.com/en-us/features/office-tools-vs.aspx

Excel 2003 Document Level Customization and Excel 2010 Compatibility

Does anyone know if there is a way to make an Excel 2003 Document Level Customization work with Excel 2010? When I try to execute this document level customization built on Excel 2003 and VSTO 2005 SE, I get the following error.
"The assembly * could not be found at or could not be loaded.
You can still edit and save the document. Contact your administrator or the author of this document for further assistance."
Any help would be appriciated.
Just to share with people what I've learned thus far.
Office 2010, specifically in this case Excel 2010, has 64bit compatibility issues with Document Level customizations and I think Add-Ins when executing solutions built on Excel 2003 files. This appears to be an issue more specifically with Visual Studio Tools For Office SE (VSTO) where the OTKLoader.dll, being 32 bit, can't be loaded by Excel 2010 64bit version.
Our specific test was to take an Excel 2003 Document Level customization built by Visual Studio 2008, and install it on a Windows 7 64 bit machine running Office 2010 64 bit. The error received is the error as stated in my original question.
We then took a Windows 7 64 bit machine running Office 2010 32 bit and installed the Office Business Application. The OBA, the documen level customization, executed without error.
You'll probably want to reference the following article from Microsoft.
"Compatibility Between the 32-bit and 64-bit Versions of Office 2010"
http://msdn.microsoft.com/en-us/library/ee691831.aspx
I personally haven't made it through the article completely, but there's enough descriptive text and some explict statements that lead me to believe that Office 2003 customizations, currently, are not compatible with Office 2010's 64 bit version.
Hope that helps someone out there. This was a real pain to sort out.
Note the options we're presenting at this time are to:
A: Only allow 32 bit versions of Office 2010.
B: All Office / Excel 2003 Document Level Customizations must be upgraded, at a minimum, to Excel 2007 solutions.
No you cant, because interop/vsto library you reference has to be different.
Excel 2003 works on VSTO 2005 SE whereas Excel 2010 needs VSTO 2010 library.
VSTO 2005 doesnt work with Excel 2010 and VSTO 2010 doesnot works Excel 2003.
To expand on your findings, Rob, yes, that is correct (you can). I believe the other contributor has made a mistake.
For 32-bit versions of Office, it will work (and it does, so you have found), but it will not work for 64-bit editions of Office. Microsoft clearly states this compatibility restriction (well, as a footnote at least).
See the MSDN article Running Solutions in Different Versions of Microsoft Office.
Under section "Running Office Solutions Created By Using Previous Versions of Visual Studio", you will see in the chart in the last row that using VSTO 2005 SE with a project template targeted for Office 2003 will run on Microsoft Office 2003, Microsoft Office 2007, and Microsoft Office 2010 (32-bit only).
It goes on further to say that you will be required to install the Visual Studio 2005 Tools for Office Second Edition runtime on the client's PC.
Your options that you described are correct. Those should be the only options that you have.

Visual Studio 2010, Office 2007 & 2010 Interopability

On my development PC, I uninstalled Office 2007 and installed Office 2010.
I have a VS 2010 Solution that has several Excel 2007 templates (projects).
When I open the Solution, VS wants to "upgrade" the project (to Office 2010). I cancelled out of that and in the VS options, I turned off "Upgrade to latest version of Office".
Now, the solution opens fine, but the Excel 2007 template projects will not load or open. All the clients that run this appication have Office 2007 intalled, so I need to be able to continue to develop this application and target Office 2007.
Can anyone tell me how to do that? (I downloaded and installed the Office 2007 PIA...)
Thanks!
As a rule I always suggest running the version of office on your development machine that you are targeting, otherwise you loose F5 support and things often don't work as they should.
Another point is that if you do upgrade to Office 2010, the add-in will still work on 2007, as long as you do not access any of the 2010 API's. So technically if you upgrade the project to 2010, then remove the reference to Microsoft.Office.Interop.Excel v14 and add v12, that will restrict you to office 2007 API's, and you shouldn't have a problem.
Just give it a go, upgrade the project, then try install it into Office 2007, it should work fine. If not, just undo/revert your local changes.
I think your problem is VSTO, VSTO 3.5 was office 2007, vsto 4 comes with VS2010 and is Office 2010.
You might check on what versions of VSTO are currently installed and make sure you've got the right ones.

How to get the document-level templates into Visual Studio Tools for Office (VSTO)

"To summarize: if you install VSTO 2005 SE on top of a clean VS 2005 Professional, you won't have the document-level templates. If you want to have them you need to have VS 2005 Team Suite/Team Edition or you need to install the previous version of VSTO: VSTO 2005. So VS 2005 Professional + VSTO 2005 + VSTO 2005 SE will give you the document-level templates!"
So my question is, does anyone have a link to a VSTO 2005 download (it is no longer available from Microsoft).
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/f2909f92-3517-49bc-9e86-c136299956bc/
As Richard said earlier in this
thread, the "document-level" project
templates (Excel Workbook, Excel
Template, Word Document, and Word
Template) are not included in VSTO
2005 SE or Visual Studio 2005
Professional. To get the
"document-level" project templates in
the 2005 release of Visual Studio, you
must have one of the following
versions of Visual Studio:
Visual Studio 2005 Tools for Office (this is a completely separate
edition of Visual Studio for purchase;
it is not a free download).
One of the "Team System" versions of Visual Studio 2005.
The VSTO development story is somewhat
simpler in Visual Studio 2008. In this
release, all of the VSTO projects
(add-ins and the document-level
projects) are now available in Visual
Studio 2008 Professional, as well as
the "Team System" versions. This
includes add-in and document-level
projects for both Office 2003 and the
2007 Microsoft Office system.
Maybe this one will help Microsoft Visual Studio 2005 Tools for Office 2005 Runtime (VSTO 2005 RTM)
The VSTO 2005 redistributable package installs the Visual Studio Tools for Office runtime, which is required to run solutions built using VSTO 2005. This runtime supports document-level customizations for Microsoft Office Excel 2003 and Microsoft Office Word 2003, and application-level add-ins for Microsoft Office Outlook 2003.