none
Building a VSTO Word 2007 Add-in solution in Visual 2012 ,Office 2013 RRS feed

  • Question

  • We have a Word 2007 VSTO addin which supports both Word 2007 and 2010. We are now trying to make it compatible with Windows 8, Office 2013.

    When we open and build the code in Visual Studio 2012 on a Windows 8, Office 2013 box we receive a build error "Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Tools.Word.ApplicationFactory'. Are you missing an assembly reference?"

    We have included the reference for the Microsoft.Office.Tools version '10.0.0.0'. We are not sure what else is needed for building the solution.

    Any help/suggestions will be very helpful.

    Thanks,

    Pallavi

    Wednesday, January 2, 2013 1:58 PM

Answers

  • Hi Pallavi

    If you install the add-in without first opening it in Visual Studio 2012 does it work with Word 2013? Unless the functionality being used in the earlier version has been removed or modified it should continue to work...

    In which version of Visual Studio did you create this Add-in? Which version of the .NET Framework does it use?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, January 3, 2013 2:37 PM
    Moderator
  • Hi K Pallavi

    I think the first thing you should explore is how PowerPoint 2013 works with these objects - independent of your add-in. That could tell you whether you'd need to change your basic approach, due to a different in Word 2013.

    My recommendation would be to set up the steps used to create these objects in 2007. If you can do it manually, as well as with your code, make both sets of instructions.

    Then try following the same manual steps in 2013 and see if Word allows it.

    My best guess, at this point, is that you may be bumping into the change in technology Word uses to work with embedded objects. Up through 2007 it was standard to use field codes (Link, Embed) and such objects were handled as OLE objects. Starting in 2007 with the move to the new file formats and introduced as "standard" in 2010, such objects are handled by default as Office Open XML files, not OLE. Only if you have a document in the old "Compatibility Mode" will you get the OLE objects.

    So, if your Add-in code is constructed to work with something in OLE that's no longer available when Word is working with the new file formats, that could explain the problem. That's what we have to figure out.

    <<The application is an Office 2007 add-in built in VS 2010. The target framework is .Net framework 3.5.>>

    This could explain why you're having difficulties building your add-in in VS 2012, although it has no effect on the problem you're seeing with the feature in Word. VS 2012 can only build VSTO using .NET 4.0 or 4.5, so you'd need to change the target version of the .NET Framework, as well as the PIAs the project targets, and perhaps some of your code.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 4, 2013 9:22 AM
    Moderator

All replies

  • Hi Pallavi,

    Thank you for posting in the MSDN Forum.

    You can try to remove the references and re-add them.

    When add reference to Word PIA, please refer to 15.0.0.0 version.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 3, 2013 10:24 AM
    Moderator
  • Hi Zhang,

    Thank you for the suggestion. We already tried that but recieve the same error. Any other tips to troubleshoot the issue?

    Thanks,

    Pallavi

    Thursday, January 3, 2013 1:53 PM
  • Hi Pallavi

    If you install the add-in without first opening it in Visual Studio 2012 does it work with Word 2013? Unless the functionality being used in the earlier version has been removed or modified it should continue to work...

    In which version of Visual Studio did you create this Add-in? Which version of the .NET Framework does it use?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, January 3, 2013 2:37 PM
    Moderator
  • i would go with Cindy's suggestion and try to not modify or open add-in in newest VS. It should work on new office just fine. If you however rebuild it using VS 2012 you _could_ loose support for office 2007.
    Thursday, January 3, 2013 5:46 PM
  • Hi ,

    Thank you for the inputs and suggestions. 

    Cindy,

    If we install the add-in in Office 2013 without opening in VS, most of the features of the application work except for a feature where we are accessing embedded PowerPoint Slide objects present in the Word document. Is there a known limitation in 2013 related to embedded PowerPoint objects created in 2007?

    We are unable to figure out the error cause just by installing the tool, hence we are trying to debug the code in Office 2013 and are facing the above mentioned issues.

    The application is an Office 2007 add-in built in VS 2010. The target framework is .Net framework 3.5.

    Damian,

    As you mentioned rebuilding in VS 2012 might lose support to 2007, is it a design limitation in Office 2013? Will it support Office 2010?


    Friday, January 4, 2013 6:23 AM
  • Hi K Pallavi

    I think the first thing you should explore is how PowerPoint 2013 works with these objects - independent of your add-in. That could tell you whether you'd need to change your basic approach, due to a different in Word 2013.

    My recommendation would be to set up the steps used to create these objects in 2007. If you can do it manually, as well as with your code, make both sets of instructions.

    Then try following the same manual steps in 2013 and see if Word allows it.

    My best guess, at this point, is that you may be bumping into the change in technology Word uses to work with embedded objects. Up through 2007 it was standard to use field codes (Link, Embed) and such objects were handled as OLE objects. Starting in 2007 with the move to the new file formats and introduced as "standard" in 2010, such objects are handled by default as Office Open XML files, not OLE. Only if you have a document in the old "Compatibility Mode" will you get the OLE objects.

    So, if your Add-in code is constructed to work with something in OLE that's no longer available when Word is working with the new file formats, that could explain the problem. That's what we have to figure out.

    <<The application is an Office 2007 add-in built in VS 2010. The target framework is .Net framework 3.5.>>

    This could explain why you're having difficulties building your add-in in VS 2012, although it has no effect on the problem you're seeing with the feature in Word. VS 2012 can only build VSTO using .NET 4.0 or 4.5, so you'd need to change the target version of the .NET Framework, as well as the PIAs the project targets, and perhaps some of your code.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 4, 2013 9:22 AM
    Moderator
  • yes, it is a design limitation - each new VS usually removes support for oldest office present. As for debugging, sure, go ahead and debug it using VS2012. But remember that you can also debug it using VS2010, just attach to already running process.
    Friday, January 4, 2013 9:25 AM
  • yes, it is a design limitation - each new VS usually removes support for oldest office present. As for debugging, sure, go ahead and debug it using VS2012. But remember that you can also debug it using VS2010, just attach to already running process.

    The caveat in all of this being whether the interop types are embedded in the project, or not. If they are, then support for add-ins is much more flexible...

    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 4, 2013 9:58 AM
    Moderator