locked
Newbie Needs to be pointed in right direction [ Short and Sweet ] RRS feed

  • Question

  • I need to get started learning how to use VSTO.  I will be using C# along with Office 2010.

    I've been programming COM-Addins using C++ for about 4 years, but now our company has gone .NET and C# happy.

    WHAT I AM LOOKING FOR:
    Books, Blogs, and Links

    WHAT DOES NOT HELP
    vb examples, and 2007 tutorials.


    Wednesday, August 8, 2012 8:32 PM

Answers

  • In terms of the process of writing VSTO AddIns, Office 2007 and Office 2010 are pretty much the same. AddIns that target Office 2007, in my experience, will work with Office 2010 (though apparently Microsoft don't officially support this practice).

    If you're moving from native AddIns, you may not be aware that VSTO, specifically, only supports AddIns that target a single Office application. You can target multiple Office apps with C# and .NET, but we don't call that VSTO (sometimes that's referred to as a 'shared' COM AddIn...a term you may already be familiar with). See here for a good walkthrough on that (it might be good to look over anyway....VSTO basically wraps/simplifies some of that process for you, plus offers you a nice Visual Ribbon Designer).

    There are two main types of VSTO AddIn...Application level and [Item] level. Application level AddIns will start up every time the target Application starts. Document level AddIns (for Word) will be tied to a particular document, Workbook level AddIns (for Excel) will be tied to a particular workbook. Depending on whether you want to build an application-level AddIn, and which application you want to program for, there's likely probably a specific walkthrough. This is an Application level one for Excel for instance; but basically once you've done it for one Office app, you've learned the process for all of them.

    You can deploy your VSTO AddIn through Click Once, Windows Installer, or various non-Microsoft methods. As you might guess, Click Once deployment is most straightforward but limited in options (for example, you can't install for all users of a computer). This is the best guide/walkthrough I've found for deploying with Windows Installer.

    Welcome to the world of VSTO! You'll probably find it, and certainly C# more forgiving and quicker to program with. Even if you do need to deploy the wretched .NET Framework on target machines...
    • Edited by JosephFox Wednesday, August 8, 2012 10:57 PM
    • Marked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    • Unmarked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    • Marked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    Wednesday, August 8, 2012 10:42 PM
  • At least for Outlook 2010, customizing the context menu options (right-click) is done by using ribbon customizations, not using commandbars. Officially commandbars are deprecated in 2010.
     
    In addition, the biggest VSTO difference I see in version 4 (2010) is that with Framework 4 you can embed your PIA's and no have to deploy them to the user. You can also target a 2007 setup as long as you check at runtime what version is running and don't use any methods/properties/events that aren't in the older object model.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "JosephFox" <=?utf-8?B?Sm9zZXBoRm94?=> wrote in message news:e05bb2ef-418e-44a1-b4e9-0f904531faa8...

    That's right, I forgot about the Backstage View/Ribbon. But there is not much different, conceptually or in practical programming terms, from the standard ribbon.

    I'm sure your native Office experience will give you a massive advantage.

    It's all still there....for example Command Bars are still the only way to customize right click options...it's just a moderate change in syntax. If the book you're talking about is Carter and Lippert, I found it well paced.


    Ken Slovak MVP - Outlook
    • Marked as answer by TSRACT Thursday, August 9, 2012 3:43 PM
    Thursday, August 9, 2012 3:18 PM

All replies

  • In terms of the process of writing VSTO AddIns, Office 2007 and Office 2010 are pretty much the same. AddIns that target Office 2007, in my experience, will work with Office 2010 (though apparently Microsoft don't officially support this practice).

    If you're moving from native AddIns, you may not be aware that VSTO, specifically, only supports AddIns that target a single Office application. You can target multiple Office apps with C# and .NET, but we don't call that VSTO (sometimes that's referred to as a 'shared' COM AddIn...a term you may already be familiar with). See here for a good walkthrough on that (it might be good to look over anyway....VSTO basically wraps/simplifies some of that process for you, plus offers you a nice Visual Ribbon Designer).

    There are two main types of VSTO AddIn...Application level and [Item] level. Application level AddIns will start up every time the target Application starts. Document level AddIns (for Word) will be tied to a particular document, Workbook level AddIns (for Excel) will be tied to a particular workbook. Depending on whether you want to build an application-level AddIn, and which application you want to program for, there's likely probably a specific walkthrough. This is an Application level one for Excel for instance; but basically once you've done it for one Office app, you've learned the process for all of them.

    You can deploy your VSTO AddIn through Click Once, Windows Installer, or various non-Microsoft methods. As you might guess, Click Once deployment is most straightforward but limited in options (for example, you can't install for all users of a computer). This is the best guide/walkthrough I've found for deploying with Windows Installer.

    Welcome to the world of VSTO! You'll probably find it, and certainly C# more forgiving and quicker to program with. Even if you do need to deploy the wretched .NET Framework on target machines...
    • Edited by JosephFox Wednesday, August 8, 2012 10:57 PM
    • Marked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    • Unmarked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    • Marked as answer by TSRACT Wednesday, August 8, 2012 11:41 PM
    Wednesday, August 8, 2012 10:42 PM
  • Thanks!  I will be sure to hit those links tonight ASAP.

    Coming from decades of C/C++ windows development I still refer back to some VC6 books for information I can't find in the newer ones from time to time.

    However, this .NET world with VSTO is a whole new animal and I wanted to be cautious about reading anything that was not 2010.  For instance, the Backstage view is Unique to 2010 and I noticed that there are some things you can now do with C# and VSTO in 2010 that was not available in 2007 (e.g.  You don't have to fill in missing parameters).

    Right now, I will focus on the basics that you've outlined quite nicely.  You've given me the confidence to purchase a VSTO/C#/2007 book.  As long as it gets me through the basics, I can use online articles to fill in the 2010 specific gaps the book won't have (e.g. Backstage view).

    Maybe in a year or two I'll be able to Pay It Forward.... thanks again.

     
    • Edited by TSRACT Wednesday, August 8, 2012 11:58 PM
    Wednesday, August 8, 2012 11:53 PM
  • That's right, I forgot about the Backstage View/Ribbon. But there is not much different, conceptually or in practical programming terms, from the standard ribbon.

    I'm sure your native Office experience will give you a massive advantage.

    It's all still there....for example Command Bars are still the only way to customize right click options...it's just a moderate change in syntax. If the book you're talking about is Carter and Lippert, I found it well paced.

    Thursday, August 9, 2012 12:34 AM
  • Yes, that's exactly the book I will be purchasing.  Once I have the basics down I'll just go over to MSDN to fill in the blanks and look up whatever required assemblies I need.  I'm already well acquainted with the various Offce Object models.

    Luckily there are plenty of C#/.NET books out there.  That won't be a problem.

    All the best

    Thursday, August 9, 2012 3:42 AM
  • At least for Outlook 2010, customizing the context menu options (right-click) is done by using ribbon customizations, not using commandbars. Officially commandbars are deprecated in 2010.
     
    In addition, the biggest VSTO difference I see in version 4 (2010) is that with Framework 4 you can embed your PIA's and no have to deploy them to the user. You can also target a 2007 setup as long as you check at runtime what version is running and don't use any methods/properties/events that aren't in the older object model.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "JosephFox" <=?utf-8?B?Sm9zZXBoRm94?=> wrote in message news:e05bb2ef-418e-44a1-b4e9-0f904531faa8...

    That's right, I forgot about the Backstage View/Ribbon. But there is not much different, conceptually or in practical programming terms, from the standard ribbon.

    I'm sure your native Office experience will give you a massive advantage.

    It's all still there....for example Command Bars are still the only way to customize right click options...it's just a moderate change in syntax. If the book you're talking about is Carter and Lippert, I found it well paced.


    Ken Slovak MVP - Outlook
    • Marked as answer by TSRACT Thursday, August 9, 2012 3:43 PM
    Thursday, August 9, 2012 3:18 PM
  • This is probably a better overview 2010 Office developer updates than my assessment. I still use CommandBars, but I haven't needed to customize Outlook 2010's context menu. Apparently PowerPoint 2010 is also an area where you can't use CommandBars.

    Thursday, August 9, 2012 3:40 PM
  • No worries.  You gave me some pretty good info.  I always double check my sources anyway.  Besides, Slovak is Mr. Been There Done That 20 times :)

    Thursday, August 9, 2012 4:44 PM