Using Windows Presentation Foundation in Office Clients

Published 10 August 09 05:31 PM

I was cleaning up my desk today and in the piles of mail and gobs of paper I found the SDN Magazine “Women in Technology” issue 101 that featured an article I wrote that was released in print back in May. Well, I just noticed today that near the end of June they made most of the articles available online, including mine. :-)

Using Windows Presentation Foundation and Line-of-Business Data in Microsoft Office Clients

In this article I talk about how to expose Line-of-Business data via ADO.NET Data Services to an Excel client using WPF. Office solutions you build with Visual Studio are designed to work with Windows Forms controls but you can also use WPF controls in your solutions as well. Any UI element that can host Windows Forms controls in an Office solution (VSTO) can also host WPF controls using the Winforms ElementHost as a container.

Using WPF controls in Office allows you to think out of the box and provide world-class data visualizations that are not possible with Windows Forms controls. And you can do it easily in an instantly familiar end-user application like those in the Office family. But what if you don’t have any fancy data visualizations? Even the simplest controls that display data are often better off as WPF controls in Office applications because they better match the UI styles used in the latest versions of Office. Using WPF can make your add-ins look built into the Office applications themselves, providing a better user experience.

This article describes one piece of the Northwind Office Business Application (OBA) we created in the beginning of the year so if you’re interested in OBA development with Outlook, Word, Excel and Sharepoint I’d suggest reading these as well:

  • OBA Part 1 - Exposing Line-of-Business Data
  • OBA Part 2 - Building and Outlook Client against LOB Data
  • OBA Part 3 - Storing and Reading Data in Word Documents
  • OBA Part 4 - Building an Excel Client against LOB Data
  • OBA Part 5 - Building the SharePoint 2007 Workflow
  • The full sample application, built with Visual Studio 2008, is here: http://code.msdn.microsoft.com/OBANorthwind 

    Of course, the rest of the magazine is pack full of awesome articles from very well known women in technology (scroll to the bottom of this page for the whole list). I’m honored to be featured with them in this issue. Thanks again to Marianne van Wanrooij and the folks at SDN for putting this together and I’ll see you in October at the SDN Conference!

    Enjoy!

    Comment Notification

    If you would like to receive an email when updates are made to this post, please register here

    Subscribe to this post's comments using RSS

    Comments

    # RobinDotNet said on August 10, 2009 10:49 PM:

    This is great. I remember when you showed an example of this at the East Bay .Net User Group meeting, I had no idea you could do WPF in an Office Add-In. Thanks for sharing the information!

    # Waleed El-Badry said on August 13, 2009 3:18 AM:

    Most of women started in "technology" became "business women" in a while :-)

    Nice article Beth but I think the bottleneck in using such an app is the deployment.

    # Beth Massi said on August 13, 2009 1:42 PM:

    Hi Waleed,

    Check out the deployment whitepapers on the VSTO Dev Center:

    http://msdn.microsoft.com/en-us/vsto/dd264713.aspx

    http://msdn.microsoft.com/en-us/vsto/dd264714.aspx

    And the VSTO blog:

    http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx

    Also we're building better deployment features into VS2010:

    http://blogs.msdn.com/vsto/archive/2009/08/03/quick-videos-of-visual-studio-2010-features-beth-massi-mary-lee.aspx

    http://channel9.msdn.com/shows/10-4/10-4-Episode-25-Fixing-PIA-Pains-with-Type-Equivalence/

    Cheers,

    -B

    # Waleed El-Badry said on August 14, 2009 4:25 AM:

    Thanks Beth for your valuable links. By the way, there is a recurring question in the community about the RTM release date of VS 2010. Since you and Liz are my Microsoft  MVS - Most Valuable Spy :- ) , I thought you could leak me some information to publish on the forum.

    Have a lovely day

    Cheers

    # Beth Massi said on August 14, 2009 11:40 AM:

    Sorry Waleed -- I would never be able to give out that kind of information.

    Leave a Comment

    (required) 
    (optional)
    (required) 

      
    Enter Code Here: Required

    About Beth Massi

    Beth is a Program Manager on the Visual Studio Community Team at Microsoft and is responsible for producing and managing content for business application developers, driving community features and team participation onto MSDN Developer Centers (http://msdn.com), and helping make Visual Studio one of the best developer tools in the world. She also produces regular content on her blog (http://blogs.msdn.com/bethmassi), Channel 9, and a variety of other developer sites and magazines. As a community champion and a long-time member of the Microsoft developer community she also helps with the San Francisco East Bay .NET user group and is a frequent speaker at various software development events. Before Microsoft, she was a Senior Architect at a health care software product company and a Microsoft Solutions Architect MVP. Over the last decade she has worked on distributed applications and frameworks, web and Windows-based applications using Microsoft development tools in a variety of businesses. She loves teaching, hiking, mountain biking, and driving really fast.

    This Blog

    Syndication

    Page view tracker