office-interop

Sending Outlook 2007 Meeting Request with HTML Body

I know that Outlook.ApointmentItem.Body only supports plain and rich text formats. But my requirement is to send the Appointment with a Html body. Currently I am saving the ApointmentItem as an ics file and attaching it to the e-mail. This works but the outcome that I am looking for is that it is received as a meeting request. I.e. I rec...

What's the use of XML file associated with office interop assembly?

When I add a reference to Microsoft.Office.Interop.Word.dll and compile the C# project, a XML file with the same name is generated in the output folder. It seems that there is no use of this file. I deleted it and the project is still working fine. I wanted to know why VS generate this XML file and what is it's use? ...

Word Spell Check pops up hidden and "freezes" my App

I am using Word's Spell Check in my in house WinForm app. My clients are all XP machines with Office 2007 and randomly the spell check suggestion box pops up behind the App and makes everything "appear" frozen as you cannot get at it. Suggestions? What do other people do to work around this or stop it altogether? Thanks Below is my ...

Outlook Interop: Password protected PST file headache

Okay, I have no problem identifying the .PST file using the Outlook Interop assemblies in a C# app. But as soon as I hit a password protected file, I am prompted for a password. We are in the process of disabling the use of PSTs in our organization and one of the steps is to unload the PST files from the users' Outlook profile. I need t...

c# .net interop close dialog boxes

After opening a Word document, using .NET interop, a dialog box is created that blocks programmatic editing of the opened file. The user cannot see the winword.exe process and so cannot close the dialog. Is there a way to close a dialog or to prevent them being opened on startup? I believe it might be the dialog asking first time users ...

How to handle resize of range upon insert column/row in Excel via VSTO

Hi all, I'm working on an Excel add-in and have an issue with ranges. Suppose we have a range on a spreadsheet - A1:D1. A user inserts a column at say column C. My VSTO Range object is still A1:D1 but I'd like it to become A1:E1. UPD: I don't expect this to happen automatically, but I wonder is there a way VSTO would help me to impl...

using excel formulas in .NET

Hello How do i use excel formula AUTOSUM for a range of columns in .NET for ex: i need something like this. Item Quantity ---------- A 10 B 20 ---------- Total 30 Thanks in advance ...

How to open Microsoft Word by function call?

I want to accomplish a few tasks: Open a Word document through my program in C# and create a document path to read or write to. Change the formatting of text in the Word document as if I wanted the Word window to give me the text in RTF format or plain text or docx (supported formats) Retrieve the text in my given format such as RTF fr...

How to improve performance of opening Microsoft Word when automated from C#?

I have Microsoft Word template that I automated filling it's fields from my application, and when the user requests to print I open this template. But creating the Word application every time a user requests to print after filling fields is very expensive and can lead to some delay while opening the template. So I choose to cache the re...

how could i know that the user clicked File->Save in word document using .NET?

How could I know that the user clicked File Save in word document using .NET? If user make any action in word document then i can know what this event in my program that made using c#. ...

Using Word COM objects in .NET, WinWord process won't quit after calling Word.Documents.Add

I'm running into the classic scenario where, when creating Word COM objects in .NET (via the Microsoft.Office.Interop.Word assembly), the WinWord process won't exit even though I'm properly closing and releasing the objects. I've narrowed it down to the use of the Word.Documents.Add() method. I can work with Word in other ways without ...

Merge Word Documents (Office Interop & .NET), Keeping Formatting

I'm having some difficulty merging multiple word documents together using Microsoft Office Interop Assemblies (Office 2007) and ASP.NET 3.5. I'm able to merge the documents, but some of my formatting is missing (namely the fonts and images). My current merge code is shown below. private void CombineDocuments() { object wdPageBr...

Best solution for exporting Word documents to PDF programatically (without using a "software printer")?

I'm looking for a way to export a Word document as a PDF. I would like to do this without the use of a "software printer" (such as CutePDF, etc.) and stick to reference assemblies if at all possible. I'm using Microsoft Office Interop Assemblies to generate a Word Document which I save to a temporary directory. So its not necessary for t...

Using Word COM objects in .NET, InlineShapes not copied from template to document

Using .NET and the Word Interop I am programmatically creating a new Word doc from a template (.dot) file. There are a few ways to do this but I've chosen to use the AttachedTemplate property, as such: Dim oWord As New Word.Application() oWord.Visible = False Dim oDocuments As Word.Documents = oWord.Documents Dim oDo...

Powerpoint file can be deleted without consequence

I am working on a license management type application that copies a password protected zip file to the applications root. The user clicks a button "Open Presentation" and the zipped file is extracted into the root folder and then I use the Office interop to open the file in Powerpoint. At this point to my surprise I am able to delete the...

When developing a Microsoft Office Add-In (for Word), is it possible to store hidden metadata information that is tied to a specific Table or Cell within a Word document?

I am trying to store metadata (basically a unique id) along with each cell of a table in a Word document. Currently, for the add-in I'm developing, I am querying the database, and building a table inside the Word document using the data that is retrieved. I want to be able to save any of the user's edits to the document, and persist it...

What is the best way to create a shortcut hook mechanism for Office

I am looking to create shortcut handler for MS Office. I am creating an addin with VS2010 for Office 2010. The handler needs to listen to all keyboard events when Word/PowerPoint is active. Although there is a lot of material for creating application level shortcut handlers, I couldn't find one that was specific to Office. It would be ...

Installing VSTO 4.0 Causes VSTO 3.0 Addin to quit working

I just installed Visual Studio 2010 yesterday. As part of that I installed VSTO 4.0. Now when I run any Office application, my VSTO 3.0 addins fail to load. The error in the event log is Customization URI: file:///H:/PathToMyAddin/MyAddin.vsto Exception: Customization does not have the permissions required to create an application do...

How can i get the between cell addresses.

I have a function which accepts fromRange and ToRange of an Excel cell. basically i want to read cell by cell values from the range. suppose if i pass E2 and E9 i want to read in a loop something like Range(E2).value, Range(E3).value and so on till E9 How can i get the between cell addresses. Please help ...

Problems with office automation in asp.net. I can use alternatives such as open-office, if I knew how xD

I have a ASP.NET 2.0 web application that should upload a ppt file and then extract its slides to images. For that I have imported office.dll and Microsoft.Office.Interop.PowerPoint.dll assemblies and wrote the following code public static int ExtractImages(string ppt, string targetPath, int width, int height) { var pptAppli...