vsto

How to host a WPF control in an MS Access VBA Form?

We have a large MS Access project that requires GUI functionality that is difficult / impossible to do in the VBA / access forms environment. Over time, we wish to re-write / migrate to a managed C# environment with WPF as the presentation layer. The only practical way for us to do this is over a longer period of time - converting som...

C# Technique - Getting Constant Values By String

Is there any good way to convert strings like "xlSum", "xlAverage", and "xlCount" into the value they have under Microsoft.Office.Interop.Excel.XlConsolidationFunction? I guess reflection would be slow (if its possible). There are about 10 of these constant values. I was trying to avoid a large switch statement if possible. ...

Troubleshooting: Can't find a referenced unmanaged dll when invoking custom code via a Word code-behind

Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp folder. I can double click the exe and everything runs. Next I have a Word 2007 code-behind project, that references relevant managed DLLs in the above folder and tries to do the same thing.. bring up the App UI. After ...

Edit structured data in MS Word

I’m faced with the task to give business users the possibility to edit generic structured data in Microsoft Word 2007. The structure of the data (an xml representation of a form) and the data is accessed through web services. I believe that the solution is VSTO, but have no experience with it. So I’m looking for design advice to choos...

What does the registry value for the outlook(2003) msgfile extension stand for?

If you want to open an msg Email file with the extension .msg, Outlook 2003 will be started with some parameters. Therefore you can find the following registry keys: HKEY_CLASSES_ROOT\msgfile\shell\Open\command\(standard) HKEY_CLASSES_ROOT\msgfile\shell\Open\command\command The first one points to the "outlook.exe" with the parameter ...

VSTO "Value does not fall within the expected range."

I'm getting an error compiling my VSTO (Visual Studio Tools for Office) project in VS. It says "Value does not fall within the expected range." and "There was an error during installation" ...

Excel VBA or VSTO - How do you loop over Fields on a PivotTable?

Here is some sample VBA code: Sub Macro1() Dim pt As PivotTable Set pt = ActiveSheet.PivotTables("SomePivotTable") 'Set colOfFields = pt.PivotFields End Sub The third line is incomplete/broken. What is the correct way to get access to collection of all the fields in a PivotTable? I need to be able to loop over them. Act...

Outlook VSTO AddIn for Meetings

We have created a VSTO addin for Outlook Meetings. As part of this we trap on the SendEvent of the message on the FormRegionShowing event: _apptEvents.Send += new Microsoft.Office.Interop.Outlook.ItemEvents_SendEventHandler(_apptEvents_Send); The method _apptEvents_Send then tests on a couple of properties and exits where appropriate...

How to cause my VSTO 2005 SE Outlook Addin to crash so that it's disabled?

For testing purposes I need to get my Outlook 2003 addin (vb.net) disabled so that it can only be reactivated through the help menu or by deleting the resilency key from within the registry. I tried to achieve this by creating an unhandled invalid cast exception during the startup eventhandler but this does not help. Outlook only says t...

How do I call a VSTO function from a formula in excel?

I'd like to be able to call a function exposed by a VSTO addin from a cell in an excel worksheet. More specifically, if I have a VSTO function Foo() that returns "bar" I'd like to be able to write =Foo() in A1 which evaluates to "bar" on calculation. Is this possible? What are the key steps I'd need to take? The prospect of being able ...

Troubleshooting: Assembly resolution for a managed dll from a Word VSTO Add-in

I have a Word VSTO Document with a code-behind dll named WordDocument1.dll Project folder D:\Work\Seven\WordAutomation\ContentControls\WordDocument1\bin\Debug I've copied some custom code into an MyAppExecs folder under that. The DLL has a private bin path specified so that code in MyAppExecs is reachable. So on startup, I load a Star...

Surface a .NET method as a UDF in Excel 2007, using a VSTO 2008 Add-in

We have an existing add-in that we publish to users via click once. We would now like to use this as a vehicle to publish some of our existing C# methods directly into Excel so that the users can call them as a UDF. For example - I have an assembly called MyAssembly, that has a class called MyClass with a public method called MyMethod. ...

Redemption Shared Folder Problem when moving to Outlook 2007

We currently have an application that works with Outlook 2003. In order to get the owner of a shared contact folder, we simply call: Redemption.RDOSessionClass.GetFolderFromID() and then took that folder and got the RDOFolder.Store.Name property. However, when trying this with a shared contact folder in Outlook 2007, the RDOFolder.Store...

Is Office 2007 PIA deployment possible without Office 2007?

Does Office 2007 PIA also require Office 2007 to be installed? Can I deploy Office 2007 PIA with VSTO 3.0 (without having Office 2007 installed)? EDIT: I have a windows application that generates MS Word files. I have added the Office 2007 PIA as custom pre-requisite in the setup, but Office 2007 PIA needs MS Office 2007 to be installed...

Differences between Excel 2003 and 2007 from a VSTO perspective

What are some of the major differences to be aware of when developing Addins or Document level customizations for excel 2003/2007? ...

Advice for extracting word text and handling cellbreak characters

Looking for advice (perhaps best practice) We have a MS Word document (office 2007) that we are extracting text from a cell. We can use the following: string text = wordTable.cell(tablerow.index, 1).Range.Text; The text is extracted; however we seem to get extra characters trailing, example "\r\a". Now we could add the following: ...

VSTO: Can't create workbooks

When I try to create a Excel or Word workbook project in VS, I get the message: A compatible version of Microsoft Office is not installed on this computer. You must install the version of Office that is compatible with your project. In addition, repair the version of the Visual Studio Tools for Office runtime that i...

How to create vertical seperator between controls on an outlook command bar?

I am creating an outlook 2003 addin which adds some dropdown and button on each mail item opened.I have created a command bar and have added the controls to that command bar . But if i look at the standard tool bar on mail message, each button is seperated by a vertical bar but in my tool bar there is no seperator. How can i create the v...

CommandBars.FindControl throwing an exception

I am trying to use the FindControl Method of the CommandBars object in a VSTO Word addin to get what else a command bar object Code is as follows private void WireContextMenu(string MenuID,string Tag, string ID, ref Office.CommandBarButton Control) { try { object missing = System.Type.Missing; ...

VSTO AddIn for Word Only

I've written a VSTO addin for Word 2003 which is working correctly. The only problem is that the adding displays a commandbar which is also appearing when I create a new email in Outlook. How can I prevent the commandbar addin from displaying in the context of Outlook and only in Word? Thanks, Brian. ...