vsto

Office VSTO Word 2003 project keeps trying to autoconvert to 2007

I am working on a Office Word add-in for Word 2003. When I reopen the project, the VS2008 auto covert dialog box opens and tries to convert it to the Word 2007 format. How can I reopen this file and keep it in the Word 2003 format? ...

.NET - Excel ListObject autosizing on databind

I'm developing an Excel 2007 add-in using Visual Studio Tools for Office (2008). I have one sheet with several ListObjects on it, which are being bound to datatables on startup. When they are bound, they autosize correctly. The problem comes when they are re-bound. I have a custom button on the ribbon bar which goes back out to the d...

How do I read/write Person metadata from a Word doc stored in SharePoint using VBA or VSTO?

Scenerio: Document library in SharePoint with column x of "Person or Group" type. From within a VBA macro (or VSTO add-in) we're trying to access the MetaProperty on the document to set/get the user name. Any attempt to access the value via the ContentTypeProperties collection throws a Type MisMatch error (13). The Type property of th...

SpecialCells in VSTO

I'm trying to use the SpecialCells method in a VSTO project using c# against the 3.5 framework and Excel2007. Here's my code: Excel.Worksheet myWs = (Excel.Worksheet)ModelWb.Worksheets[1]; Range myRange = myWs.get_Range("A7", "A800"); //Range rAccounts = myRange.SpecialCells(XlCellType.xlCellTypeConstants, XlSpecialCellsValue.xlTextV...

Options for PivotTables in Excel

I need to design a small project for generating excel reports in .NET, which will be sent to users to use. The excel reports will contain PivotTables. I don't have much experience with them, but I can think of three implementation alternatives: Set a query for it, populate it, send it disconnected. This way the user will be able to g...

Exposing .net methods as Excel functions?

I have a set of calculation methods sitting in a .Net DLL. I would like to make those methods available to Excel (2003+) users so they can use them in their spreadsheets. For example, my .net method: public double CalculateSomethingReallyComplex(double a, double b) {...} I would like enable them to call this method just by typing a ...

How Do I detect Text and Cursor position changes in Word using VSTO

I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects. Does anyone know if this is possible without polling the docume...

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 iterate through all the cells in Excel VBA or VSTO 2005

I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar / comfortable working with the concept of 'Range'. Therefore, any sample codes would be greatly appreciated. (I did try to google it, but the code snippets I found...

Deploying VSTO Project to Server

Is it possible to place an application using vsto if the office is not installed? It doesn't appear to be so, but I was wondering if anyone had a work-around. ...

Which IDE should I use for developing custom code for InfoPath Forms, VSTA or VSTO?

I am new to developing for Office Forms Server / MOSS 2007. I have to choose between designing my web-based forms and writing code for them in Visual Studio Tools for Applications (aka VSTA) or Visual Studio Tools for Office (aka VSTO). VSTA is included free as part of the license for InfoPath 2007; VSTO, also free, requires Visual Stu...

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 ...

VSTO Excel 2007 PivotTable, having a PivotField in more than one column

I am using VSTO with Excel 2007 to generate PivotTables and PivotCharts dynamically. I am having a problem when I need to have a PivotField in more than one column. To accomplish this I create a PivotTable in Excel and serialize its properties into an XML document, which I then use to rebuild the PivotTable. Ie: as a Value and as a Co...

Use VBA in Office 2007 Applications?

Is VBA going to go away any time soon, like VB6 has? Should I not develop new Office applications with VBA? Or should I be developing all new Office Apps with VSTO? Update: Recently read this article. ...

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? ...

How to create Excel 2003 UDF with a C# Excel add-in using vsto 2005 SE

I have seen this http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx. However i want to get this working in C# Excel add-in using vsto 2005 SE, can any one help? ...

Restore Office Environment to Default after development

After I develop my add-in for Microsoft Office ( and in the process messed up all my menu bars and tool bars) using Visual Studio For Office, is there anyway to restore the MS Office to default? For the record, Clean Solution alone is not enough! ...

Create a new Word Document using VSTO

How can I create a new Word document pro grammatically using Visual Studio Tools for Office? ...

.Net Localization problem

I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1) and .Net 3.5 The code simply takes the position a chart using the Top and Left properties and stores it in an XML file. The problem im facing is that when the xml is generated using a Vista Ultimate + Excel 2007 + English environment the code works perfectly...

Export pictures in Microsoft Word to TIFF

How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images. ...