Visual Studio 2013 refuses to work with Office 2016 - visual-studio-2013

I'm trying to create projects in Visual Studio Pro 2013 for use in Office 2016. I know it's supposed to be possible, but VSTO seems to insist I need Office 2013.
I've followed several MSDN walkthroughs (Add-In, Document-level, custom tab), and always end up with errors like these:
I checked the registry, and my .NET framework is version 4.6.1. I added the runtime and targeting packs for 4.6 and 4.6.1 to Visual Studio, but keep getting the same results.
The errors come up when I get to the "hit F5 to run the project" step. Any suggestions or solutions?
Background: I'm an MS Word forms developer in a corporate environment. Of our 1,000-or-so forms, about 100 of them have custom toolbars, which haven't been available since the ribbon interface after Office 2003. We modify them with a non-networked machine using the old software. I've been tasked with finding a way to regain functionality similar to custom toolbars in Office 2016, our current baseline. The only version of Visual Studio available to me is VSTO Pro 2013.

Your Excel Project => Properties => Debug tab => Start external program
Set it into excel 2016
The path like C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.EXE
If you cannot debug after that, try to attach the process to debug using Visual Studio.

Related

Visual Studio 2013 VSTO not creating Word 2010 project

I'm trying to develop a Word Document add-in through Visual Studio 2013, using a Word 2010 Document selected from the Visual Studio project menu of Office/SharePoint Office Add-ins. It is needed to tie in SharePoint 2013 with a collaborative Word document. I keep getting the error message:
Project cannot be created because the "Word Visual Studio Design-Time Adaptor Add-in" is not working correctly. Word might have disabled the add-in or made it inactive, or all add-ins might be disabled in your Trust Center settings. Check the add-in status in Word Options. If the add-in is active and enabled, reinstall or repair Visual Studio Tools for Office.
I have checked that there is no disabled add-ins in the Trust Center, and I do see the Visual Studio Tools for Office Runtime in the Add-ins. I cannot find any other options, as I have reinstalled the Visual Studio Tools for Office as well.
Where should I go from here?
I had the same problem, turned out that one of the updates was causing the problem. (Breaking the VSTO plug-in in some way)
What I did was reinstall Office, and I manually told Microsoft Update not to install updates that were launched after Oct 2016, I could then create Document-Level projects again.

Office 2016 add-in development in Visual studio 2013

We need to develop add-in for the Office 2016. We are using the Visual studio 2013. It is only showing the Office 2013 add-in templates. Is it possible to create Office 2016 add-in from Visual studio 2013? If so, kindly let me know the steps.
You need VS 2015 to get the specific templates for Office 2016. VSTO only ever provides templates for "current" versions of Office.
If Office 2013 is installed you can develop an Add-in for it. There should be no problem installing and running it in Office 2016 - unless you want to use technology specific to 2016. In that case, you could use late-binding (PInvoke) for the 2016-specific portions, but debugging/testing would be a bit of a pain.
You can download the free Visual Studio 2015 Community edition (https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx) as well as the VSTO package (https://www.visualstudio.com/en-us/features/office-tools-vs.aspx): VSTO does integrate into the Community edition for version 2015 (and 2013, for that matter). Licensing restrictions would apply, of course.
Other than that, you'd need to upgrade to a full VS 2015.
You can develop and run Office 2016 addins in VS2013. No need to upgrade to VS2015.
Install VSTO 4.0 extension for VS2013
Create Office 2013 plugin using Visual Studio template
Open project file and replace office version string "15.0" to "16.0" in ProjectExtensions section. Look for this of similar string to edit:
OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Outlook" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\15.0\Outlook\InstallRoot\Path#outlook.exe"
Yes, it is possible. The add-in created in Visual Studio 2013 can be run in Office 2016. You can read more about that in the Running Solutions in Different Versions of Microsoft Office article.
In case if you need to use new methods and properties available only in Office 2016 you can use the Reflection mechanism (see Type.InvokeMember).
there is an example for Outlook, i tried it for Excel and it works as well.
my example:
<ProjectProperties HostName="Excel" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="16.0" VstxVersion="4.0" ApplicationType="Excel" Language="vb" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Excel\InstallRoot\Path#excel.exe" DebugInfoCommandLine="/x" AddItemTemplatesGuid="{DCFE8D25-4715-4C33-9EAB-A34A9EBC9544}" />
i changed
OfficeVersion="15.0"
to
OfficeVersion="16.0"
and the path to Excel
#Software\Microsoft\Office\16.0\Excel\
as well, finally it starts in Excel 2016...

Office 2010 addin written in visual studio 2013

Using visual studio 2013 I have written an outlook addin for office 2013 and this all works fine, however I now need to make it compatible for office 2010.
I thought I would create another project under the same solution which uses the office 2010 addin which all worked fine until I closed the solution and re-opened it and now it is saying it needs migrating.
If I migrate it, it changes the references to use office15 (instead of office14) so it is now essentially a copy of my original project.
Does anyone know how I can sort it to have the addin work for both office 2010 and 2013?
UPDATE:
Even when I create a new solution in VS2013 for an office 2010 addin, close and re-open the solution it is still asking me to migrate and then it converts to office 2013.
The add-in should work in earlier Office versions if you don't use new features (new properties and methods). But in most cases, you need to replace the interop assembly with the one which corresponds to Outlook. VSTO allows to run add-ins in different versions of Office. See Running Solutions in Different Versions of Microsoft Office

Updating an Office 2010 Add-In to support inline response in Office 2013

I currently have one Add-In project that supports both 2010 and 2013 versions of Office. The only difference is the setup project I use to install the Add-In. One searches for the 2010 PIA and the other for the 2013 PIA. I'm able to support both versions this way. The only problem is that since I'm using the v4.0 libraries I can't access the tools for supporting inline response in 2013.
I currently have Office 2013 and Visual Studios 2010 installed of my machine, can I updated the references from the Office 2013 installation? I understand that if I update my project to support the inline responses, it might brake the compatibility with 2010. This is fine as I can just have two projects.
Do I need VS2012 or higher to support the Office 2013 libraries?
Okay, this took a little while to figure out. All you need to do is delete the Microsoft.Office.Interop.Outlook and stdole and add the Microsoft Outlook 15.0 Object Library reference. I couldn't find the PIA for the Office 2013 originally as they show up as COM instead in .NET in the Add Reference form in VS2010.
After that, the this.Application.ActiveExplorer() should have inline response events. You don't need VS2012 to support the libraries. While I separated the inline response code by checking the application version, I haven't had the chance to test on Outlook 2010 to make sure it works. I'll edit this answer once I do.

Does InfoPath 2013 support Visual Studio 2013?

I am trying to develop custom code for an InfoPath 2013 form. I have Visual Studio 2013 Professional installed, but when trying to edit code I get the following message:
The following external components are required to edit your form code. Please install them and try again.
Microsoft Visual Studio 2012
Visual Studio C# Support
Microsoft Visual Studio Tools for Applications 2012
C# support is installed, along with Visual Studio Tools for Applications 2012.
Does InfoPath 2013 just not support VS2013?
Unfortunately No
MS has really been making some bad decisions lately
Firstly VS2013 was released so they forced people to upgrade if you want to develop for Windows 8.1
Secondly, MS have announced that they are dropping InfoPath and have yet to provide an alternate solution. Support is still available but InfoPath 2013's successor will be another solution.....i'm guessing Azure Forms or SharePoint forms, something like that
Very disappointing
As you have found, adding code to an InfoPath 2013 form requires Visual Studio 2012. I am not aware of a way to use it with any other version of Visual Studio.
Depending on what you plan to use the custom code for, you may be able to get by with the qRules library (full disclosure: I am one of the developers of this library). It contains many of the most common features for which people tend to use code within InfoPath, and you can use them simply by executing rules within your form, eliminating the need for any version of Visual Studio.
If there is a specific thing you are looking to do with code, I can tell you whether it's possible to do so with qRules, but you should open a separate question for that (and let me know here).

Resources