Microsoft Office Reporter

 
Get Top Posts and Jobs
Weekly via Email:

Subscribe
Unsubscribe

Search Posts:


Title Only
Title and Body
 

Search Jobs:


Title Only
Title and Body
77 posts from: Andrew Whitechapel

HLSL in Office

(Indexed 2009-07-22):

HLSL is the High Level Shading Language for DirectX, documented here. I was wondering the other day how you might use shaders in Office, and this led me to build a little proof-of-concept that allows you to experiment with HLSL within the context of an Office application. I built a PowerPoint add-in that provides a custom task pane which displays a WPF usercontrol. The task pane allows the user to select an image file, type in arbitrary HLSL code to build a shader, and apply that shader to the i...(truncated)...

Excel Services Getting Started Pt4 Web Service APIs

(Indexed 2009-05-20):

This continues my previous checklists here, here and here on getting started with Excel Services. In this post, Ill append a walkthrough for using the Excel Web Services APIs.6. Using Excel Web Services APIs6.1 Create an publish a workbook (RegionalSales.xlsx)a. We could use any of the workbooks weve already published, but for simplicity, well create a new one. Using Excel client, create a simple spreadsheet to represent regional sales. In one column put labels for the sales...(truncated)...

Excel Services Getting Started Pt3 EWA

(Indexed 2009-05-05):

This continues my previous checklists here and here on getting started with Excel Services. In this post, Ill append a walkthrough for using Excel Web Access.5. Using Excel Web Access5.1 Make the EWA web part available in your sub-sitea. Note: this task is only required if you did not base your site on the Document Workspace template.b. We want to create a new page for this sub-site, using the Excel Web Access web part. However, the EWA web part is not available by defa...(truncated)...

Excel Services Getting Started Pt2 UDFs

(Indexed 2009-04-25):

This continues my previous checklist on getting started with Excel Services. Here, Ill append a walkthrough for creating, deploying and updating User-Defined Function assemblies with Excel Services.4. Create and deploy a UDF assembly4.1 Create a UDF assembly in Visual Studio (SampleUdf.dll)a. Im assuming here that your developer machine is not the same as your Excel Server machine. When you build UDFs, you do need to reference an assembly that is part of Excel Services, but ...(truncated)...

Excel Services Setup and Getting Started

(Indexed 2009-04-21):

As part of an internal prototype I was working on recently, I had to set up a machine for Excel Services and do this repeatedly as my prototype messed up the installation in various ways. I found lots of MSDN documentation that covered all aspects of setting up the base server OS, setting up MOSS, and configuring MOSS for Excel Services in a multitude of possible configurations but what I wanted was a nice concise checklist so that I could reliably setup an E/S box whenever I needed to. I coul...(truncated)...

MEF in Office?

(Indexed 2009-04-08):

In my last post, I looked briefly at MEF, and Im wondering how this model can be applied to Office add-ins. The Office add-in model itself already achieves a level of dynamic composition, by virtue of the fact that the set of add-ins to be loaded is only discovered at runtime. However, even though the model is similar at a high level, Office itself does not use MEF.Nonethless, MEF could perhaps be useful in an Office context. For example, suppose you want to build the add-in itself as a composi...(truncated)...

MEF

(Indexed 2009-04-01):

The Managed Extensibility Framework (MEF) is a new library, still under development, that provides support for composing applications dynamically. Many applications have a composite model, where the total functionality is provided by a number of component parts. Often, these components are all known at design-time, so the composition is static. However, it is sometimes useful to be able to build the composition dynamically where the set of components to be loaded is only discovered at runtime. ...(truncated)...

Carter-Lippert VSTO Book Updated

(Indexed 2009-03-14):

The eagerly-awaited update to Eric Carter and Eric Lipperts VSTO book has been released this week. This is the definitive guide to Visual Studio Tools for Office, and this edition targets development for Excel, Word and Outlook 2007 using Visual Studio 2008. Eric and Eric have done another excellent job, and the book weighs in at 1055 pages jam-packed with in-depth insights into VSTO development. The ToC looks like this:Part I An Introduction to VSTO1. An Introduction to Office Programmi...(truncated)...

Silverlight Web Part in SharePoint

(Indexed 2009-03-13):

Having looked at Silverlight in Office client, I thought Id round out the exercise by looking at Silverlight in Office server. It turns out that lots of people have looked at this before, and I relied heavily on information from several other peoples blog posts (see below), the Silverlight Blueprint for Sharepoint, and Steve Fox and Paul Stubbss new book. To host a Silverlight app in SharePoint, youll need the Silverlight Tools for Visual Studio 2008 sp1, which you can download for free here. Y...(truncated)...

Silverlight Deep Zoom and Office Add-ins

(Indexed 2009-03-08):

I had some free time today waiting to give a demo at an MVP conference session the session over-ran, and I found myself sitting in the hallway for an hour. So I got to thinking about Silverlight and Office. If we assume that Silverlight is more or less a subset of WPF, then it makes little sense to build any Silverlight into an Office add-in: youve already got the regular CLR loaded, so why would you want to load a second CLR with a subset of the capabilities? Plus, theres the performance consi...(truncated)...

Exposing Events From Non-VSTO Add-in Automation Objects

(Indexed 2009-03-02):

I posted a while back about exposing an automation object from an add-in that fires events. That post was couched in terms of VSTO add-ins. A customer asked recently how the same technique could be used in a non-VSTO add-in. So, thats the topic of this post.First, heres my automation object and the interfaces it implements. IAddInUtilities is a regular incoming interface that defines one method, CreateCustomTaskPane. The AddInUtilities class implements this method: because the AddInUtilities cla...(truncated)...

Message Hooks in Add-ins

(Indexed 2009-02-25):

Just like my earlier post on message filters, this is an advanced scenario so be warned: you almost certainly dont want to do this. However, there are probably some extreme edge-case scenarios where this technique might be useful. For example, Office apps are notoriously parsimonious with their events. Im sure you can all cite situations where it would be really nice if Office fired an event, but it just doesnt. In this situation, it might be useful to intercept raw windows messages instead (an...(truncated)...

Passing Objects to Exposed Add-in Methods

(Indexed 2008-11-30):

Ive posted a few times on the best way to expose methods from an add-in to automation clients for example, here, here and here. So far, in my examples, Ive described very simple exposed methods that take no parameters but what happens if you want to expose a method that does take one or more parameters? The answer depends on the type of the parameter(s). If you want to pass some simple type a value type or a string theres nothing extra you need to do. So, lets suppose your interface and expo...(truncated)...

Launching Office Apps Programmatically

(Indexed 2008-11-30):

There are at least 9 different ways to start or connect to an Office app programmatically in managed code, as summarized in this table:PIA InteropUsing the Office PIAs is the most RAD approach, with the greatest level of design-time and compile-time support. This has to be the preferred approach for almost all scenarios. A variation of this is the use of embedded PIA types using ComImport, as described here and here. Process.StartThe simplest fire-and-forget approach, useful if you want to launc...(truncated)...

Using Managed Controls as ActiveX Controls

(Indexed 2008-11-25):

Can you use a managed usercontrol in an Office document in the same way that you can use a native ActiveX control all without using VSTO? Some time ago, I posted about how to use native ActiveX controls within a doc-level VSTO solution, by wrapping them in managed usercontrols. A reader (Casey) asked the question, what about going the other way? The answer is maybe. Or, to be more precise, up to a point, but the technique is unsupported and probably won't work in most scenarios. If you still wa...(truncated)...

Implementing IMessageFilter in an Office add-in

(Indexed 2008-11-20):

First a warning: this is an advanced scenario, and you should not attempt to use this technique unless youre sure you know what youre doing. The reason for this warning is that while the technique described here is pretty simple, its also easy to get wrong in ways that could interfere significantly with the host application.Problem description: you build an Office add-in that periodically makes calls back into the host object model. Sometimes the calls will fail, because the host is busy doing o...(truncated)...

Exposing Events from Managed Add-in Objects

(Indexed 2008-10-13):

Following on from my recent posts on exposing add-in objects, here and here, it occurred to me that its sometimes useful to be able to expose events from these objects. Recall that you can expose your add-in through the COMAddIn.Object property in the Office OM, either directly (in a non-VSTO add-in) or through VSTOs RequestComAddInAutomationService mechanism (documented here).For example, lets suppose youre exposing an object from your add-in that provides a DoSomething method, like this:namesp...(truncated)...

Exciting PDC Session

(Indexed 2008-10-06):

Under the Hood: Advances in the .NET Type SystemThis is one session you absolutely must not miss. It looks pretty innocuous, but it's actually a very big deal. This talk is an in-depth examination of some of the enhancements we're making in CLR v4.0 (and in the C# and VB language compilers) to support shared-type scenarios. These include scenarios where you have multiple managed assemblies that need to talk to each other through some shared interfaces, as well as native-managed interop scenarios...(truncated)...

AddInSpy - Diagnosing/Troubleshooting Office Add-ins

(Indexed 2008-10-01):

AddInSpy is a new diagnostic tool for reporting the maximum possible information about all Office add-ins registered on a machine. This is a free (unsupported) download, available on MSDN Code Gallery here. Covering article on MSDN here.In fact, there are 2 tools: AddInSpy, which is a WPF GUI application, and AS, which is a scriptable console application. They both use the same scanning engine, so results are identical. Both tools allow you to produce an XML report of add-ins, and AddInSpy addit...(truncated)...

Version-Specific UI in Add-ins

(Indexed 2008-09-03):

Continuing on from my earlier posts on building add-ins for multiple versions of Office, avoiding the PIA version conflict, and add-ins for multiple versions without PIAs, a reasonable way to design your solution would be to use the lowest-common-denominator PIAs (lets say, the Office 2003 PIAs) and then use ComImports for any additional features introduced in later versions of Office. This way, you avoid having to declare ComImports for the vast majority of the Office and Office app object mode...(truncated)...

COM Shim Wizard 2.3.1.0

(Indexed 2008-08-27):

Weve released a slight update to the COM Shim Wizard. This is available as a free download here, and the covering article is on MSDN here. The differences Between v2.3.0.0 and v2.3.1.0 are summarized below.SetupThe major difference between v2.3.0.0 and v2.3.1.0 is that v2.3.0.0 was built to install with Visual Studio 2005, whereas v2.3.1.0 installs with either Visual Studio 2005 or Visual Studio 2008, or both. The setup for the COM Shim Wizard now gives you the option to choose which version or ...(truncated)...

Activating a Custom Tab on the Ribbon When a Document Is Opened

(Indexed 2008-08-20):

Harry 'Play It Again Sam' Miller has posted a wonderfully funny video on this topic - with a serious message. You've got to check this one out: http://blogs.msdn.com/vsto/archive/2008/08/12/activating-a-c...(truncated)... [Image]

COMAddIns Race Condition

(Indexed 2008-08-13):

You can expose an arbitrary object from your add-in as a kind of extension to the Office host applications object model. To do this, you set your object as the value of the Object property on the COMAddIn object that represents your add-in in the hosts COMAddIns collection object. You can do this directly in a non-VSTO add-in, or through VSTOs RequestComAddInAutomationService mechanism.If you intend for this to be used by other add-ins, VSTO doc-level customizations, VBA, or any other in-proc ex...(truncated)...

Why your COMAddIn.Object should derive from StandardOleMarshalObject

(Indexed 2008-08-11):

In general, it is important that any code in a managed Office add-in should execute on the main UI thread. The reason for this is that there are several components that simply will not work when executed from any other but the main UI thread examples include calls on WinForms controls, and calls into the VSTO runtime. Fortunately, in most normal circumstances, your add-in code will run on the main UI thread. However, there is one scenario where you need to be more vigilant. Recall that you can ...(truncated)...

Creating a PivotTable Programmatically

(Indexed 2008-07-26):

I received an email from a customer the other day asking how to set up an Excel pivot table programmatically. The Excel OM exposes a number of objects and methods that you can use to create pivot tables, some more sophisticated than others. I wanted the simplest possible way to set up a pivot table from an external data source, and this is what I ended up with...I used the AdventureWorks SQL database, which you can download from here. In my solution, I first set up a data connection to the datab...(truncated)...

Demand-Loading VSTO Add-ins

(Indexed 2008-07-15):

In an earlier post, I talked about how you could delay (or prevent) the loading of managed code using a native add-in. In that post I also listed the standard LoadBehavior settings, and I was assuming that everyone knows how these apply, but I got a couple of follow-up questions that prompted me to clarify the normal (LoadBehavior-based) demand-loading mechanism, and how it applies to VSTO add-ins.Its pretty simple: you can set up any Office COM add-in (native, managed, VSTO) for demand-loading ...(truncated)...

Add-ins for Multiple Office Versions without PIAs (Pt2), or _VtblGap

(Indexed 2008-06-24):

In my last post, I discussed how you could avoid any dependency on the Office PIAs by using ComImport to redefine the host applications OM interfaces. Someone (A Developer) pointed out that I had actually omitted the trailing 2 members of the IRibbonControl interface and I mentioned that this wouldnt stop the code working. I also mentioned that omitting interface members is a valid technique, so today Ill explain what I mean by this.Im attaching the sample solution to this post and you can com...(truncated)...

Add-ins for Multiple Office Versions without PIAs

(Indexed 2008-06-03):

In a previous post, I discussed how you could build an add-in for multiple versions of Office, and explained the problems in this approach (and why it is not officially supported). One of the reasons this is not supported is because you end up building an add-in which has dependencies on a later version of the Office PIAs, even though your add-in is sometimes deployed to a machine with an earlier version of Office. The canonical example is where you build an add-in that conditionally uses both O...(truncated)...

PDC 2008 Open for Registration

(Indexed 2008-05-28):

Its been 3 years since the last Professional Developers Conference, so Im pleased that were doing one this year its about time. This years PDC is on Mon-Fri Oct 27-30, with a one-day pre-con on Sun Oct-26, at the Los Angeles Convention Center (same as last time). [Image]The main site is here. There will be more than 160 sessions, and weve already announced the first 40 or so here. Here are a few teasers:Office Business Applications: Enhanced Deployment This session will explore how Visual Stud...(truncated)...

Ribbon and Task Pane in Access Add-ins

(Indexed 2008-05-22):

In an earlier post, I looked at how you could morph a VSTO project for one application into a project for another application specifically, how you could build a VSTO add-in for Access. Note that this is explicitly not supported. However, although this was only intended as an investigative exercise, I notice that some people have added comments to the post asking for further information about things like custom Ribbons. So, to continue the investigative exercise, Ill look today at how you could...(truncated)...

The Case For Shared Add-ins

(Indexed 2008-05-09):

People have been building native shared add-ins for Office (and related apps) since their introduction in Office 2000. People have been building managed shared add-ins since the introduction of .NET in 2002. VSTO support for managed add-ins was introduced in 2005. It is clear that the strategic technology choice is managed code, and for Office add-ins it is VSTO. For a discussion of the main reasons why traditional managed add-ins (aka shared add-ins) are problematic and how VSTO add-ins addre...(truncated)...

Delay-loading the CLR in Office Add-ins

(Indexed 2008-04-19):

Suppose you control your enterprise desktops to the extent that you control which add-ins are installed. Suppose, further, that you want to avoid the hit of loading the CLR at application startup. One way is to delay-load your managed add-ins. The registered LoadBehavior for an Office add-in governs how the add-in is loaded (surprise). Note these values are in decimal:LBMeaningStatus in COM Add-ins DialogBehavior Description0UnloadedDisconnected, UnloadedThe add-in is not loaded when the applica...(truncated)...

VSTO Loader and Runtime Components

(Indexed 2008-04-03):

Perusing the forums over the last few months, its clear that theres some confusion about the various VSTO loader and runtime components. At the time of writing, there are 4 versions of VSTO in existence, including 4 sets of design-time tooling and 3.5 versions of the VSTO runtime. I say 3.5 versions, because the VSTO 2005 SE runtime was an in-situ replacement for the VSTO 2005 runtime, and both are considered VSTO v2 (2005 SE was purely additive to 2005). Other versions that is, VSTO 2003 (v1) ...(truncated)...

Integrating Doc-level and Add-in Solutions

(Indexed 2008-03-21):

Everyone knows you can build document-level Office solutions and you can build application-level Office add-ins. Suppose your requirements dictate that you build a solution that uses both techniques can this be done? First, lets pause and consider whether this is a good idea in the first place, and whether you could re-architect to use only one or the other.In most cases, the requirements for a solution can be met either with doc-level solutions or app-level add-ins. The Office applications COM...(truncated)...

ActiveX Controls in VSTO Solutions

(Indexed 2008-03-13):

In the past, before it became strategically acceptable to build Office-based solutions in managed code, it was common for people to build such solutions using pure COM technologies. They built native COM add-ins, using C/C++, or they built document-level customizations using VB and VBA. In some scenarios typically doc-level the solutions made heavy use of ActiveX controls. Typically, the solution used both standard and custom ActiveX controls, often on the document surface and (rather less co...(truncated)...

VSTO Power Tools

(Indexed 2008-03-06):

I announced the release of v1 of the VSTO/VSTA Power Tools last time, and they've been getting quite a bit of use so far. The downloads are here - these include an overview document. Note that the documentation for the individual tools is installed in the same folder where you install the tools themselves.Phil Hoff, who was one of the developers working on the Office Interop API Extensions library has a number of very interesting blog posts, and I encourage everyone to check them out - there's l...(truncated)...

VSTO/VSTA Power Tools v1.0

(Indexed 2008-02-21):

As I announced at the Office Developers Conference in San Jose this week, were releasing a set of power tools that complement the developers experience when building Office-based or VSTA-based solutions. These tools are freely downloadable here. Were releasing these tools independently of our normal Visual Studio release cycle even though in many cases we are considering rolling them into Visual Studio itself in a later release. These tools are unsupported if we wanted to officially support th...(truncated)...

VSTO Add-ins for Access?

(Indexed 2008-02-19):

In my previous post, I looked at how the VSTO add-in model is flexible enough to be used in prototyping scenarios for versions of Office not yet released. In principle, the same applies to Office host applications that are not currently supported.VSTO supports add-ins for most Office applications that support IDTExtensibility2-based COM add-ins, that is: Excel, InfoPath, Outlook, PowerPoint, Project, Visio and Word, but not for Access, FrontPage, Publisher or SharePoint Designer. The VSTO AddIn ...(truncated)...

Add-ins for Office 14

(Indexed 2008-02-01):

Following on from my previous post, it should be clear that we've designed the VSTO Office add-in support to be optimally useful across multiple different Office host applications and spanning multiple Office versions. To be very clear, let me reiterate: we cannot support something we have not tested. We have not tested support for currently unsupported Office applications such as Access. And, we clearly cannot test future versions of Office. That said, my assertion that VSTO add-ins are a long...(truncated)...

Jobs in Visual Studio Biz Apps

(Indexed 2008-01-31):

The Visual Studio team is growing and we have several exciting developer positions open! If youre looking for big challenges, if youre driven to innovate, if you are looking for big impact and responsibilities, then you can join us.We are building developer tools and infrastructure for Windows SharePoint Services and the SharePoint Server platform. We are going to invent, design and influence a wide range of RAD developer tools for the fastest growing server product in Microsofts history. Were ...(truncated)...

Back To The Future

(Indexed 2008-01-29):

Or, Prototyping VSTO Add-ins for Unsupported Office Versions/ApplicationsIt is in the nature of the VSTO 2005 SE and VSTO 2008 add-ins that they will run in multiple versions of Office. One of the main reasons for designing them this way is to mitigate the disconnect between the Office ship schedule and the Visual Studio ship schedule. Each version of Visual Studio provides tools support for the version(s) of Office that exist at the time it is released. Clearly, any given version of Visual Stud...(truncated)...

Managed Automation Add-ins

(Indexed 2008-01-24):

I've been thinking more about calling unmanaged XLL UDFs from managed code than about managed automation add-ins lately, but an automation add-in issue came up the other day, and I thought I'd throw it out there. If you want to build managed UDFs without going to the extreme of managed XLLs, you have a couple of simple choices: You can use a VBA wrapper approach as described in Paul Stubbs' post here: Or build an automation add-in instead, as described by Eric Carter here: and i...(truncated)...

Feed your geek

(Indexed 2008-01-15):

We're 26 days away from the 2008 Office Developer Conference. I've been roped in to talk about the VSTO/VSTA Power Tools all of which are useful, and some of which are actually very interesting.Remember, the ODC is open to the public for the first time it promises to be a significant event. Registration is open. Check Steve Fox's blog for up-to-date information on the Office Client Track. Also check the ODC team blog for detailed information on the conference overall. When: February 10-13, 20...(truncated)...

Invoking Native Excel UDFs From Managed Code (Pt2)

(Indexed 2008-01-01):

In my previous post, I looked at how to build a VSTO add-in that invokes native XLL UDFs via the Excel COM OM (specifically, Application.Run). In this second part, I'll look at the same managed client calling the same XLL UDFs via the Windows API instead of Excel's COM OM, specifically using LoadLibrary and GetProcAddress.Continuing with the same VSTO add-in project I used last time, I added a class for the native imports (I looked up pinvoke.net for the signatures). I also declared a delegate w...(truncated)...

Invoking Native Excel UDFs From Managed Code (Pt1)

(Indexed 2007-12-14):

As part of a little ongoing investigation, I wanted to communicate between a managed add-in and a native XLL UDF. As I was writing this up, it turned out to be a much longer post that I planned, so I've split it into two parts (I'll post the second part in the next week or so, mince pies permitting). Obviously, you can build managed code to invoke methods exposed by the Excel COM object model. The question is, can you build managed code in an add-in, say to invoke unmanaged UDFs (which are not...(truncated)...

Building an Excel XLL in C/C++ with VS 2008

(Indexed 2007-12-10):

As part of a little investigation I'm doing at present, I needed to build some simple native XLLs for testing purposes. This was the first time I had a need to build XLLs since the Excel XLL SDK was updated back in September. The updated Excel 2007 XLL SDK is available for free download here. The online documentation is here. There's also an old support article on how to build an XLL with C++ here this refers to the Excel 97 SDK, but the information is still valid (although it doesn't use any o...(truncated)...

Do You Know the Way to San Jos

(Indexed 2007-12-08):

Momentum is gathering for the 2008 Office Developer Conference, and here's the skinny: When: February 10-13, 2008Where: San Jose Convention Center, San Jose, CAWho: 2000 developers and architects who build solutions on the Office platform. The event will include the usual MSFT suspects, the usual key partner suspects, and anyone else who has an interest in building Office-based solutions. Unlike previous Office DevCons, this one is open to the public. This is a good opportunity to exchange ideas...(truncated)...

Implement ICustomTaskPaneConsumer in C++

(Indexed 2007-12-05):

The new extensibility interfaces introduced in Office 2007 are implementable via add-ins. Add-ins can be managed or unmanaged (native). If you're using VSTO, development is greatly simplified. However, if you want to build a native add-in to implement one of these interfaces, life is a little more complex and there doesn't seem to be any documentation on how to do this. What follows here is an exploration of how to build a native (C++ ATL) "shared" COM add-in that implements a custom task pane....(truncated)...

COM Shim CLR Loader Bug

(Indexed 2007-11-26):

The latest version of the COM shim wizards was released back in the summer, here. With the help of Adam Smith of Xobni (and of course, the indispensable Misha), we've identified a minor bug with the project code that the wizard generates for the shim. In fact, this bug was identified prior to the last release (as you can read in Misha's blog comments here), but we simply forgot to include the fix my apologies for that.Part of what the shim does is to load the CLR: it does this by calling CorBin...(truncated)...

VSTO + WPF + WCF + LINQ (MSDN Article)

(Indexed 2007-11-26):

There's an article in this month's MSDN magazine on building Office-based solutions using VSTO with WPF, WCF and LINQ. The point of the article is to affirm that all these disparate technologies do indeed work well together, and that the design-time experience of building such a solution is suitably RAD. The article is also online here. Right now, the accompanying sample code download is unfortunately an early version that doesn't match the article (thanks to Andy Cheung for pointing this out). ...(truncated)...

Sharing Code Between Add-ins

(Indexed 2007-11-24):

Suppose you want to build a Ribbon customization, or a custom task pane, and you want to use this customization in multiple add-ins? For example, you might want to use the same customization in say an Excel add-in and a PowerPoint add-in. It's pretty simple to achieve this: all you need do is abstract common functionality out to a separate class library, which can then be shared amongst multiple add-in projects. As you do this, you'll encounter a few simple decision points: such as, where to dra...(truncated)...

Preserving the alpha channel when converting images

(Indexed 2007-10-10):

Here is a guest post by Eric Faller, Ribbon developer guru and all-round nice guy. It's a follow-up to my post about converting between the image formats used by Office and the .NET framework. Ill be talking about handling the alpha channel (transparency) of the images, mentioned at the end of that post and in the comments. Id recommend reading that post first in order to get up to speed on the IPictureDisp interface and some of the other concepts well be discussing.Id also recommend reading th...(truncated)...

WPF in VSTO

(Indexed 2007-08-15):

Can you use WPF controls in VSTO solutions, and if so, how? VSTO's mission is to bring together the unmanaged Office platform and the managed development world. One aspect of this is the ability to build VSTO solutions that use managed controls within native Office windows. There are 5 places you can do this: Arbitrary Windows Forms custom dialogs Custom task panes in application-level add-ins The document actions pane in document-level solutions Custom form regio...(truncated)...

Converting between IPictureDisp and System.Drawing.Image

(Indexed 2007-07-31):

This is an interesting manifestation of the gap between COM-based native servers, such as the Office client apps, and managed code. There are a number of scenarios where you need to convert image formats between the native COM-based IPictureDisp and the managed System.Drawing.Image class and its derivatives such as Bitmap. One such scenario is in providing images for custom ribbons, including ribbon images used for Outlook custom form regions.You have several choices for performing the conversio...(truncated)...

Updated COM Shim Wizards

(Indexed 2007-07-05):

In our spare time, Misha and I have been working on and off on the COM Shim and associated COM Shim Wizards for the last few years, and we've just published a new version here: Isolating Microsoft Office Extensions with the COM Shim Wizard Version 2.3, with the accompanying download here.The new version includes all the old projects for smart tags and RTD components these have not changed since the previous version. The significant changes in the new version are all in the add-in shim and the ...(truncated)...

Can you build one add-in for multiple versions of Office?

(Indexed 2007-06-16):

This of course is the advantage of using the old "shared add-in" project types you can build one add-in that targets all versions of all Office apps that support COM add-ins (ie, 2000 onwards). The question is, can you do something similar with VSTO add-ins? The answer is "No, not in any supported way". If you're a responsible upright citizen, you'll stop reading now.So, what kind of a cowboy hacker are you anyway? OK then, we'll explore the reasons why it's hard to get this to work, and hopefu...(truncated)...

Why is VS development not supported with multiple versions of Office?

(Indexed 2007-06-08):

First, the Office client apps are COM-based. Normal COM activation relies on the registry. COM registration is a "last one wins" model. That is, you can have multiple versions of a COM server, object, interface or type library on a machine at the same time. Also, all of these entities can be registered. However, multiple versions can (and usually do) use the same identifiers, so whichever version was registered last overwrites any previous one. Also, when it comes time to activate the object, on...(truncated)...

Office 2007 New Extensibility Interfaces

(Indexed 2007-05-30):

Office 2007 introduced a set of new extensibility interfaces. Prior to Office 2007, there were several extensibility interfaces, which all behaved differently, required different development techniques, different deployment/registration and different runtime lifetime characteristics. These included ISmartTagRecognizer, ISmartTagAction, ISmartDocument and IRtdServer. The only interface that was usefully implementable in a COM add-in was IDTExtensibility2 and, of course, the add-in had to impleme...(truncated)...

Editable TreeView

(Indexed 2007-05-25):

As I was updating the COM Shim Wizards (the new version should be published in a couple of weeks), I found I had a need for an editable TreeView. There is only limited support for editing in the standard TreeView. So, I did what all sensible people do I LiveSearched for it to see if I could reuse something out there. To my surprise, there really wasn't anything (I double-checked with Google). However, I did find an article on building a better combobox, so I borrowed a couple of the techniques ...(truncated)...

Why is it so hard to shim IRibbonExtensibility?

(Indexed 2007-03-09):

The COM Shim Wizards are a set of Visual Studio 2005 project wizards that automate the generation of COM shims for non-VSTO managed Office extensions. These shims support COM add-ins, smart tags and real-time data components. The shim for each is broadly similar, although there are obvious differences to allow for the different interfaces that each component implements, registration differences and so on. There have been many questions in the forums over the last few months as to why these shims...(truncated)...

VSTO Add-ins, COMAddIns and RequestComAddInAutomationService

(Indexed 2007-01-16):

The COMAddIns property is a collection of COMAddIn objects exposed by Office applications that support COM add-ins. The COMAddIn interface defines a small number of methods/properties, such as the ProgId of the add-in and the Connect state. It also defines an Object property. By default, the value of the Object property is null. An add-in can set this value itself, and the purpose is to expose this add-ins functionality to external callers. VSTO supports this mechanism through a new virtual meth...(truncated)...

COM Developers are from Mars, VBA Developers are from Venus, or: Typing, Binding and Wrapping in Office Development

(Indexed 2007-01-08):

I paused over my final mince pie today, and pondered the psychology of Office developers (as one does). Office development is a curious mix of different programming philosophies that has given rise to a number of interesting behavioral practices among developers. I picked the title for this post because one of the curious things is that VBA developers are in fact COM developers, though they might not know it. Firstly, the Office system of applications at least on the client consists of a range...(truncated)...

Low-level support for ICustomTaskPaneConsumer, IRibbonExtensibility, FormRegionStartup, etc.

(Indexed 2006-12-23):

Im mostly interested in the runtime aspects of VSTO, and less interested in the RAD design-time aspects (however wonderful they are), and in this post I want to explore some of the low-level infrastructure that the VSTO runtime provides. As a developer building add-ins using VSTO, you mostly (and rightly) dont care how the plumbing works, so long as it works, and you wont ever code against the low-level infrastructure directly. However, theres a middle level which you could code against if you w...(truncated)...

Multiple Instances of Custom Form Regions

(Indexed 2006-11-29):

In my last post, I considered the final state of the FormRegionStartup interface, with the 2 new methods introduced right at the last minute. This is barely documented (hence my post). Custom form regions in general are barely documented, and another issue that occurs to me is the problem of multiple instances.So, youve written a class to implement the FormRegionStartup interface, and you know that you typically implement the BeforeFormRegionShow method to hook up the form region controls to ref...(truncated)...

GetFormRegionIcon and GetFormRegionManifest

(Indexed 2006-11-24):

The Outlook FormRegionStartup interface was enhanced right before Office 2007 was released. Two new methods were added. The existing documentation doesnt explain these methods in any detail not even in the developer help within Office. The existing VSTO documentation does include mention of the two new methods, but doesnt explain how to use them. It does, however, explain how to create a VSTO add-in for Outlook 2007 implementing the FormRegionStartup interface:http://msdn2.microsoft.com/en-us/...(truncated)...

Synchronizing Ribbon and Task Pane

(Indexed 2006-10-21):

The new custom task pane model in Office 2007 is interesting. It certainly opens up a wide range of opportunities for providing a better user experience than the doc-level ISmartDocument-based task pane. Its also interesting in that it provides some challenges for Word and InfoPath developers see previous post.The thing thats most immediately obvious is that individual add-in developers now have a lot of freedom in how they design the resulting user experience. Office provides the basic framewo...(truncated)...

The Anomalous Behavior of Custom Task Panes in Word and InfoPath

(Indexed 2006-08-14):

Try this: create an add-in for Excel/Outlook/PowerPoint/Access with a custom task pane. Run the solution, see the custom task pane. Open another Excel workbook, see the custom task pane. Now, create an add-in for Word or InfoPath with a custom task pane. Run the solution, see the custom task pane. Open another Word/InfoPath document/form, and... where's the task pane?In essence, the custom task pane is always parented to a doc-frame window, not to the main app window. In Outlook, it is parented ...(truncated)...

Custom Task Panes: Doc-Level and App-Level

(Indexed 2006-07-31):

With VSTO 2005, you can build doc-level custom task panes (although we called them ActionsPanes). Our doc-level task panes were built on the old ISmartDocument technology effectively, VSTO offered a streamlined RAD mechanism for building smart doc solutions. With the upcoming Cypress release of VSTO 2005, you can also build app-level custom task panes for Office 2007. App-level custom task panes are built on an entirely different mechanism, using the new ICustomTaskPaneConsumer interface. Worki...(truncated)...

Jobs in VSTO and VSTA

(Indexed 2006-07-24):

The industry is waking up to something the cool kids have known for a long time: you can build serious applications using Office as a base platform and Visual Studio as your toolset and runtime engine. One consequence is that our team is rapidly expanding, and we have open positions in all roles: SDE (Developer), SDET (Tester), PM (Program Manager). Were very keen to get first-class candidates in to interview for these posts asap. So, if youre super-smart, super-cool, and want to work in a team ...(truncated)...

Excel Interop Types in Shimmed Automation Add-ins

(Indexed 2006-07-23):

In my previous posts on shimming Excel automation add-in UDFs, I've used simple examples where the methods tended to take and return standard types such as doubles and ints. Someone asked a question recently - what about Excel types as parameters? In other words, how do you write the shim for a method that takes say an Excel Range object as a parameter? So, here's an example. The simplest process to adopt is to build a regular COM add-in (that implements IDTExtensibility2), and then shim it. Thi...(truncated)...

COM Shim Wizards v2

(Indexed 2006-06-09):

Today we release v2 of the COM Shim Wizards. These are updated versions of the wizards we released in 2004 for Visual Studio 2003. The new wizards work with Visual Studio 2005.There's a covering article here:http://msdn.microsoft.com/library/default.asp?url=/libr...(truncated)... can download the wizards here:http://www.microsoft.com/downloads/details.aspx?FamilyI...(truncated)... wizards allow you to build unmanaged shims for managed Office extensions, including shared add-ins, smart tags and r...(truncated)...

The Evolution of VSTO v3

(Indexed 2006-04-04):

We have two main reasons for releasing early builds of VSTO v3. The first is to unblock developers so that they can get started building solutions against Office 2007, ready for when it releases. The second is to get feedback on our designs and the early implementation of those designs. A case in point is the support we have for the three new UI extensibility features in Office 2007: custom task panes, custom ribbons, and Outlook custom form regions. Backing up a second here, it should be clear...(truncated)...

VSTO 'v3' CTP Released

(Indexed 2006-03-25):

As you can imagine, we're working hard on the early stages of our Orcas release of Visual Studio. VSTO is the one SKU of Visual Studio that is closely aligned with Office. So, as we make our CTP (Community Technology Preview) releases between now and Orcas RTM, we'll aim to align them with Office releases. Bill Gates announced the first VSTO CTP release at the Office Developer Conference this week. This build of VS is based on the Whidbey (VS 2005) release, and built against Office 2007 beta1 Te...(truncated)...

Jobs on the VSTO and VSTA Teams at Microsoft

(Indexed 2006-03-03):

Would you like to help realize the vision of Office as a development platform? Do you want your work integrated into every one of the hundreds of millions of desktops that have Office installed? Are you looking for a role where you can influence the product strategy and make a significant impact on an emerging product? If you answered YES! to any of these questions then the VSTO and VSTA team at Microsoft (Redmond, Washington) is the place for you. The VSTO and VSTA team has openings and is loo...(truncated)...

VSTO Embraces MAF

(Indexed 2006-02-21):

VSTO was originally designed to support the building of managed extensions to Office applications. Visual Studio Tools for Applications (VSTA) was branched from VSTO with the aim of providing the same kind of support for all applications, managed or unmanaged. VSTO and VSTA are both built by the same team. Now that VSTA has been validated in a number of host applications (including InfoPath), it is now effectively a superset of the VSTO functionality. Or to put it another way, VSTO is an Office-...(truncated)...

Converging the Office Add-in Model

(Indexed 2006-02-18):

Over the years, Office has exposed a number of different extensibility mechanisms, which all enable developers to build solutions based on Office. Each of these mechanisms is geared towards a different set of requirements, and the design of the extensibility interface reflects these different requirements. Think of the options: COM add-ins, XLLs and WLLs, XLAs and DOTs, automation add-ins, realtime data servers, Excel UDFs via XLLs, smart tags, and smart docs. For each of these technologies, you...(truncated)...

Interaction Between Loaded Add-ins

(Indexed 2005-10-04):

Can you talk across add-ins? With the old IDTExtensibility2 model? With the new VSTO model?COM Add-ins can be accessed (from any code that can talk to the host applications OM) via the COMAddins collection property on the host Application object. The COMAddins object exposes 4 properties and 2 methods. The only really useful members are the Count property and the Item and Update methods. You use the Item method to get a specific COMAddin object from the collection (specified by either numeric in...(truncated)...