vsto

How do I store program state information in a saved excel file from an application-level add-in?

I'm trying to make an application-level add-in for Excel and I would like to store certain information about the program's state. The information I want to store pertains to the state of each Excel file (rather than across all Excel files). ...

What's currently the best way to extend Excel using C#?

I have the professional versions of VS2008 & VS2010. I wish to add a couple buttons to a toolbar in Excel. When they are clicked I'd like to be able to open a form (either WinForms or WPF is fine) collect a few values from the user in the form and then take that data + read cell values from the current worksheet to perform some databas...

How to have an excel addin read rows from a worksheet until no more data?

I've started writing a Com addin for Excel 2003 using C#. I'm looking for a code example showing how to read in cell data from the active worksheet. I've seen that you can write code like this: Excel.Range firstCell = ws.get_Range("A1", Type.Missing); Excel.Range lastCell = ws.get_Range("A10", Type.Missing); Excel.Range worksheetCells =...

Adding WPF Text Writer Trace Listener in an Outlook Add In using wpf window/control

I'm working on a outlook 2003 AddIn using VSTO SE.We have few customized windows developed in WPF. It looks there are few client machines have problem with WPF rendering due to which there could be an exception due to addin is getting disabled. I added a outlook.exe.config and added trace listeners for wpf Trace sources. I set it up acc...

Is it possible to write an Addin that works in both Excel 2003 and 2007?

I've been writing a shared addin for Excel 2003. It adds a menu (CommandBarPopup) and a couple menu items off it (CommandBarButton) that when clicked open a WPF window to read a couple values and manipulate the worksheet. Is there a way to write it so that it would work in office 2007/2010 as well, or is it impossible? If so, can anyo...

How to determine if VSTO 2010 Runtime is Installed?

It was easy to check if VSTO 2005 SE was installed by just calling MsiGetProductInfo() with the product code {388E4B09-3E71-4649-8921-F44A3A2954A7}, as listed in MSDN. What is the product code for the VSTO 2010/4.0 runtime? Or is there a better way to determine if it's already installed? This is for our installation process. Thanks!...

Outlook VSTO AddIn Configuration

I'm working on VSTO addin for outlook 2003.Outlook can read the startup section from Outlook.exe.config. <startup> <supportedRuntime version="v1.0.3705" /> <supportedRuntime version="v1.1.4322" /> <supportedRuntime version="v2.0.50727" /> </startup> But it is not able to read the system.diagnostics section of the confi...

Helpful advice on developing a professional MS Word add-on

A few months back I put together a simple proof-of-concept piece of software for a small firm with an idea for a document editing tool. The company wanted this tool to be integrated into Microsoft Word, understandably, to maximize its accessibility to the average user. I essentially wrote the underlying library with all of the core func...

VSTO addin (2003-2007) Ms Word & Webservices

Hi, I am planning on starting my 1st VSTO project. What I want to be able to do is: Download and Upload versions of a MS Word document to a web service. With authentication by overriding the save button Call a web service to list a bunch of tag that can be inserted into a document. When a user double clicks a tag the selected tag is ...

Unity configuration error - That assembly does not allow partially trusted callers.

I have an VSTO (outlook-addin) application that uses Unity. It is deployed to a folder inside Programs Files and full trust is set on that folder to allow all code FullTrust that runs from there. What I am getting now is a strange error that I cannot get to the bottom of. System.Configuration.ConfigurationErrorsException: An error occ...

determine/improve excel opening time

I have an add-in (actualy 2 one for 2003 and one for 2007). I have been receiving some complains that the office product is opening slower when my add-in is installed. Is there a way to improve the opening of office product? Is there a way to compare the opening of the office product with/without the addin ...

How to determine where a Mailitem is being opened from in Outlook 2007 using VSTO 2005 SE

I have an Outlook 2007 Add-in in VSTO 2005 SE that allows users to save e-mails into our document management system. From within our system users are able to open e-mails they have previously saved. However, when doing so I need to try and prevent them from saving them again. I am trying to figure out how to determine if the Mailitem ...

How to use a dialog in an Excel shared addin

I'm writing a shared addin for Excel. It adds a CommandBarButton that when clicked opens a WPF window to collect some information from the user. I wanted to keep the same WPF dialog in memory and reuse it so that if the user clicks the CommandBarButton again their previous values would still be there. So I made a reference to my WPF di...

Translate a Excel Range to a row/col

Hi, I have looked all over but can't find an answer to this... Quite simply put I have a VSTO Excel 2007 project that I want to be able to translate a cell (e.g. "A1") to integers row 1, column 1. Does anybody know of a built in method for this or do I have to write my own parser? ...

Name Values in Excel Object model

I am using VSTO to create an Excel add-in. My plan is to persist objects inside of excel workbooks by serializing them to strings and assigning those strings to be the values of names in the workbook. However, when I call the API function to add the new name, I get a mysterious exception from the COM library. More precisely, I am call...

Upgrading VSTO project to .net 4 - What references do I actually need?

I'm developing an application for Office. It originally targeted .net 3.5, but I decided to upgrade to .net 4 because of some WPF issues that I've run into. When I switched all the projects in my solution and rebuilt, I got an error saying to include System.Xaml. I did that and rebuilt, and VS2010 told me to include another referenc...

Microsoft Excel: Programmatically create a hidden named range.

I am told that the Excel object model permits a Range that is not a part of any sheet, yet contains a set of cells and is denoted by a name in the workbook. Can anyone explain to me how these fit into the Excel object model and how one would go about creating such a thing programatically (either in VBA or .NET source code). Thanks. ...

VSTO - Outlook 2007 How do I show a form inside the Outlook window?

Hello everyone, I'm using VSTO with Outlook 2007 and I need to show a form (or a user control) inside the main window in outlook when the user clicks a specific toolbar button, that is, I need it to appear in the same window that the reading pane appears and not to open in a window by itself. Is this possible? Thank you for your time. ...

What is the C# equivalent of this Excel VBA code for Shapes?

This is the VBA code for an Excel template, which I'm trying to convert to C# in a VSTO project I'm working on. By the way, it's a VSTO add-in: Dim addedShapes() As Variant ReDim addedShapes(1) addedShapes(1) = aBracket.Name ReDim Preserve addedShapes(UBound(addedShapes) + 1) addedShapes(UBound(addedShapes)) = "unique2" Set tmpShape ...

Testing VSTO Applications?

I'm developing a Word 2007 VSTO application in VS2008. The part of the application that interacts with VSTO is difficult to test. VSTO objects behave differently than most class libraries. Their state and behaviors depend on how the user is interacting with Word, where they clicked, what's around the insertion point, etc. Mock objects co...