office-interop

Configure PowerPoint using interop API

Hello. I am using powerpoint interop API to open a slideshow from a new instance of PowerPoint (in this case, PowerPoint 2007). In my app, I need to avoid the mouse changing the slide or showing up the right-click menu, so I manually configured that in PowerPoint. What I did: 1.- For left click I went to "Animations">"Advance slide" ...

Accessing Office Word object model through asp.net results in "failed due to the following error: 80070005 Access is denied."

I have developed a website that allows users to upload office documents then uses the office object model to convert the document to an HTML file that it then displays in an iFrame. I have, of course, included references to Office.interop.word, and the site works fine on my development machine. When I uploaded it to my production ser...

Can a loaded DLL know where it is located?

Hello community, I am building a DLL that is used by Office. When Office runs with it, I would like to identify where it is located. Is that possible? ex. of code within the DLL when it is run within Office: // should return C:\tmp\officeaddin.dll, // currently C:\Program Files\Microsoft Office\Office 12 MessageBox.Show(Application.S...

Access All Custom Fields on a MAPI folder

I am trying to export data in a Microsoft Exchange 2003 public folder. However, I can not seem to retrieve the list of all non-standard/custom fields in the folder. When I try MAPIFolder.UserDefinedProperties I get an empty list. I have tried the following code, but it gives me some (not all) of the custom fields. var document =...

PowerPoint 2003 with PowerPoint 2007 compatibility pack save as pptx

Hi, I want to create and save a PowerPoint presentation as PPTX using PowerPoint 2003 PIA, with office 2007 compatibility pack installed? is it possible how do i achieve this? PropertyValues.PptPresObj.SaveAs(_pptTemporaryFilePath, PpSaveAsFileType.ppSaveAsPresentation, _ MsoTriState.msoFalse) T...

Copy the contents of a DataGridView in to excel

I found some examples of how to create a excel file from a data grid view, however those just create the file. What I would like to do is have excel open, with a unsaved worksheet, and have the content of the data grid view (including header names) pasted in to the worksheet after pressing a "Export to Excel" button. Basically I want to...

Interop directly with office graphing component from c#

I am working with a legacy application that uses the office graph.exe ( C:\Program Files\Microsoft Office\Office14\graph.exe ) I add a reference to the graph.exe component in my c# project and when I try to initialize the component I use: using Microsoft.Office; Interop.Graph.GlobalClass c = new .Interop.Graph.GlobalClass(); Interop....

How to add / create a custom field over the Outlook Object Model

Hi, i'm developing a plugin which analysis every incoming email on the fly. Gathered information from the this process I need to display in a custom created column (over Outlook i can do that with the field chooser but only available fields). The question is now how the heck I'm able to add this. I searched the web for the past 2 hou...

Changing font (Trebuchet MS, Calibari) in Excel programmatically C#

I am currently working in a C# application which has a class which will generate an excel file. Everything went smooth. The data populated on the excel sheet has 'Times New Roman' has font. I would like to change it to some other fonts (Calibari). How can I do that programmatically. ...

Install Office 2003 or 2007 Update: Redistributable Primary Interop Assemblies on Windows Server 2008 R2

Trying to install and utilize Office 2003 (or 2007) Update: Redistributable Primary Interop Assemblies on Windows Server 2008 R2 for a Legacy Application that requires PowerPoint. Microsoft claims neither 2003 or 2007 PIA words on 2008 R2. Does anyone know a workaround to configure and enable the PIA (ideally 2003)? ...

Time that an Outlook MailItem was read or flagged

I'm developing a small add-in for Outlook 2010 using the Microsoft.Office.Interop.Outlook assembly. As part of my add-in, I'd like to be able to determine the date/time a mail item was last marked read or flagged for follow-up. I thought that the LastModificationTime property of the Microsoft.Office.Interop.Outlook.MailItem class might...

Interop, undo all actions in word undo stack

Hi, I am using c# and word interop. How can I, programmatically, undo all actions in word undo stack? Regards. ...

How to Add Office Graph in word

Hi every one this is my first question here. I want to add a Office Graph in word 2007 using C# 4.0, I am using Office 2007 word, for better charts like 3D Bubble My task is to Genrate Graph and table from sql database i have done it in good menner with using the excel chart then copy chart as image in word. now i want to add chart ...

How to add new column at the beginning of worksheet to an existing excel using microsoft interop

Hi I have an excel with 8 columns. I'm trying to add a new column at the beginning of the worksheet. The existing columns should shift. Below is the code which I tried: OpenExcelWorkbook(@"d:\TLC\TLC3.xlsx"); _sheet = (Excel.Worksheet)_sheets[1]; _sheet.Select(Type.Missing); _sheet.Co...

"There is insufficient memory. Save the document now." error while opening word 2003 document

Hi, I have developed one windows service through which I am trying to open an word document. But when service tries to open document, it logs following error "There is insufficient memory. Save the document now." If I run the same program as normal windows application, it works fine but problem comes only when I try to run the program...

Problems with Microsoft Excel COM Automation

So I wrote a method in my company's product a year and a half ago that makes use of Excel 2007's COM automation to export data, only now I'm finding that it's no longer working on machines in the office. I tested the functionality of the method on my own machine and got the same result. Digging deeper, I found that when I get as far as...

Office 2003 interop with only Office 2010 installed

We have an application (.NET 2.0) that uses Outlook 2003 features (Microsoft Office 11.0 Object Library). My new computer has Windows 7 and Office 2010 installed, and the references don't work anymore (there's only Office 14 Object Library available). Is there any way to use Office 2003 dlls when Office 2010 is installed (I've heard th...

Open word 2003 (doc) file using open xml file format API

Hi, I would like to know whether its possible to open Open word 2003 (doc) file using open xml file format API? like office 2007. I have one windows service through which I am trying to open and edit doc files but getting lot of problems.I have posted question regarding that problem here but got no answer. After lot of googling, I c...

Word interop- ParentContentControl is null for content control contained within a simple text box

Hi, I am using word interop to edit docx files. In word doument I can have multiple nested content controls, in some cases I have a content control 'A' containing a text box (simple text box inserted from Insert-Text box-simple text box) the text box contains in turn a content control 'B'. When entering the nested content control 'B', ...

RSS feed in excel

Hi, How do I import an RSS feed into Microsoft Excel ? For e.g. I would like to show a daily quote in the Excel file, which is pulled from an external RSS feed URL. Appreciate your help, thanks! ...