vsto

Read page headers and footer from Word.Range - VSTO Word Interop C#

I have a Range object and I want to use it to extract information from the page where the Range reside in. The information is in the headers and the footers inside a table, I want to read the text from the table. I tried: word.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].Shapes.Range(ref pageNumber).TextFrame.TextRange...

How to delete Excel.Name object?

I have a bunch of Excel.Name objects under Workbook.Names collection which contain invalid references. In other words, when I evaluate the Excel.Name.RefersTo property, I get a value back beginning with "=#REF...". I tried to run the following code but it seems to have no effect in removing the names: var ranges = myWorkBook.Names; for...

Microsoft Outlook/Exchange server-side mail processing

I would like to be able to process incoming emails for a particular account. Things like parsing subject/body, process/save any attachments, upload processed data to a database, etc. Another thing I have seen at one firm I worked at that I would like to be able to replicate, is setting up an email account that processes the subject of i...

Inspector.WordEditor is Nothing (Null)

I have an add-in for Outlook 2007 developed with VSTO 3.0 in Visual Studio 2008, written in VB.NET I am listening for NewInspector events and wrapping the Inspector object, then listening for the Activate event where I attempt to grab the WordEditor. The property is always returning null now. This was not happening before, and the only ...

Word AddIn Doesn't Load, But When I Change Visual Studio's "Solution Configuration" from Debug to Release It Loads

Hi, I apologize if this is a duplicate but I couldn't find any solutions that worked or any symptoms identical to mine. I have a VSTO Word AddIn I've been developing for awhile. I've never changed Visual Studio's (2010) "Solution Configuration" before; I've just left it as Debug. But today my AddIn has stopped loading in Word. It ap...

ComException while adding a new Item to Outlook

I'm developing an Outlook 2007/2010 plugin in VSTO (the project is for 2007, but works also with 2010). This application works with certificates (the System.Security.Cryptography.X509Certificates.X509Certificate class), which are handling some time after initialization (in other threads); I suspect this may be the reason for the ComExcep...

identify heading in an ms word document using C#

I need to identify the headings and normal texts in a ms word document separately and put them in two different columns of an excel sheet. This is a VSTO application using C#. ...

Excel: ListObject can't write into a data-bound object's Nullable<int> columns.

I have a VSTO 4 (Visual Studio 2010) document-level Excel 2007 add-in where I use a ListObject to display data I retrieve from a WCF web service, which uses EF to fetch the data from the database. Some of the columns are Nullable<int> (as the database column is defined with NULL, and EF maps DBNull to null), and those that have null are ...

Unable to create custom toolbars in VSTO 2003(Template project) in design time

Hi, I am trying to create a Word 2003 Template project in Visual Studio 2008. Customize button is disabled in the TemplateProject toolbar. Could anyone please let me know if there are any options in VSTO to create custom toolbars and menus in design time? I am able to create them programmatically. By using the following code: newT...

How to keep a value in the Excel validation list dropdown as one item if it has a comma in between.

Hello, We are making a c# application that would generate a XLS file of a certain format. On one of the columns we have added a validation list the values of which would be Dynamic(coming from the database). Sometimes there are values such as "Shoes,Apparel". Problem is if we put this as a formula in the validation list, they appear as ...

Can you load/use custom forms from a C# AddIn in Outlook 2003?

As part of a VSTO C# AddIn, I need to be able to display the category information on an e-mail in the message window/email item inspector (If it makes any difference, I don't need to display it when there is no category information) so that an end reader can see the category information upfront. I was told trying to replace the default o...

Visual Studio 2008 and Office 2003

I have been interested in using the VSTO but I am running Visual Studio 2008 and I have Office 2003. I know it is possible to use VSTO 2005 SE for Office 2003 but I can't find any information on programming Office 2003 with VS2008. Is this possible? If so how do I do it? ...

PowerPoint: How to get the current slide in multi-selected slides?

I selected multi-slides in the current presentation, But I want to get the slide which in the current document view. I tried to use the following code for getting the slide, Globals.ThisAddIn.Application.ActiveWindow.View.Slide But it failed, I still got the first slide in the selected slides. Any suggestion? ...

Is there a way to add an image into slide thumbnail only in PowerPoint

I want to add an image to the slide thumbnail in left panel, but it should not show in the Slide. I found the following code to add image to slide: Microsoft.Office.Interop.PowerPoint.Shape viShape = slide.Shapes.AddPicture( lockImgFile, Microsoft.Office.Core.MsoTriState.msoFalse , Microsoft.Office.C...

VSTO Outlook: Creating a dynamic custom context menu for a mail item determined by subject line

Is it possible to add different items to a mail item custom context menu by inspecting the contents of the item? For instance, only add the item if the subject line contains "IMPORTANT". ...

Couldn't use Activation Context API from within Excel 2007 Add-in on Windows XP/2003?

I use VS2008 to develop a excel 2007 add-in, within add-in I want to use Activation Context API to instantiate a COM class. The werid thing is I can instantiate the COM class successfully on Window 7, buf fails on Windows XP/2003. Here's the code-snippet string codeBase = this.GetType().Assembly.CodeBase; string asmFullPath = new ...

Programmatically play the sound of a shape in PowerPoint

I am working on a PowerPoint 2007 VSTO add-in, and I am running in a small issue. The add-in adds sounds to the current slide using the following code: var shape = slide.Shapes.AddMediaObject(soundFileLocation, 50, 50, 20, 20); The resulting shape does have a sound, and can be played through the PowerPoint slide. My problem is that, g...

Problem creating an Excel 2007 Workbook project in VS2010

I'm trying to create a new Excel workbook project in Visual Studio 2010 but it's not working. I get the error "Cannot open the workbook in the designer, because Visual Studio cannot find a required object for Microsoft Office Excel. To fix the problem, repair your installation of Office." I've repaired both Office and VS2010, uninstalle...

How to register VSTO add-in from a Wix# MSI installer

I have built several Office add-ins (Excel, Word, PowerPoint and Outlook). I have also written a single Wix#-based MSI installer to install these add-ins. I have managed to do everything correctly but now I am puzzled how to register the add-ins. One can do this interactively by double-clicking an accompanying VSTO file in Windows Explo...

Can I change the Sender's name in an email already sent on an Exchange Server?

If I get an email from [email protected] and I want to change the sender's name to [email protected], how would I do it? Could I modify the email that already resides on the server? I do not want to forward the email... just change it in place. I am happy with an app that connects to the exchange server and does it, or something that r...