officedev

Best practice for passing parameters in Microsoft Visual Studio Tools for Office (VSTO) 3 (C#)

Many of the parameters for interacting with the Office Object model in VSTO require object parameters that are passed by reference, even when the notional type of the parameter is an int or string. I suppose that this mechanism is used so that code can modify the parameter, although I can't figure out why these need to be passed as gen...

How to verify existence of a table with a given ID in a word doc in C# VSTO 3

I want to check for the existence of a table with a given ID in a word document in C# (VS 2008) Visual Studio Tools for Office (version 3). Obviously I can iterate through the document's Tables collection and check every ID, but this seems inefficient; the document will end up having a few dozen tables after I'm done with it, and while ...

Expose VSTO functionality to VBA w/o local admin

What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, no HttpListener)? Would it be possible to use Microsoft Message Queues from VBA? ...

Selecting Office 2003/2007 COM Object (Correct One) in Winforms Application

We are creating a Windows Form application (C# or VB.NET) that needs to reference an Office 2003 or Office 2007 COM object, depending on the version of office installed. What is the best way to handle this scenario and reference the correct COM object at runtime? ...

What is the best way to create user help documentation for an Excel VBA solution?

VBA solutions can vary widely in size. I would like to add user help documentation to all solutions but the level of effort to create and deploy the help needs to match the size of the solution. ...

Visual Studio Tools for Office (VSTO 2005) newbie deployment question.

I have Visual Studio setup with a VSTO word project, and when I hit run it runs fine. But, how do I setup a word document to use my code without having Visual Studio running? ...

Microsoft Visual Studio Tools for Office. Is it worth using?

It seems like deployment of VSTO code is very cumbersome. My use case is I need to enforce a certain content structure in word. Am I better of doing it all in VBA? ...

System.Windows.Forms.ToolStrip height or autosize

I'm using a series of ToolStrips in an Excel 2007 Actions Pane. I'm programatically adding buttons to each ToolStrip and then adding each ToolStrip to the actions pane. So far so good; my ToolStrips appear, with their associated ToolStripButtons. The problem comes with displaying the entire contents of the ToolStrip. I have ToolStrip....

In Excel automation, how to gracefully handle invalid file format error upon file opening?

I'm trying to open a Microsoft Excel file in a C# program using the 'excelApp.Workbooks.Open()' method. As it happens, if the format of the file is invalid, this method causes an error message box to be displayed. I, however, don't want that; I wish to handle this error gracefully in my own code. My question is, how do I do that? The ...

Will the Microsoft Office Information Bridge Framework Work With Office 2010?

I have inherited an application built using the Microsoft Office Information Bridge Framework 1.6. My task is to make this application work with Office 2010. I am testing this on a computer with the Office 2010 beta installed, including .NET programmability support for all features. When I try to install IBF 1.6, the installer won't com...