office-interop

C# Outlook interop and OpenSharedItem for opening MSG files

Is there any tutorial or resource I can follow in order to use the OpenSharedItem outlook interop method. My goal is to read MSG files using it (as it can apparently do so). ...

C# Outlook 2007 COM interop application does not exit!

Any ideas why the following code does not exit the Outlook 2007 process created via COM interop? Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); var item = app.Session.OpenSharedItem("C:\\test.msg") as Microsoft.Office.Interop.Outlook.MailItem; string body = item.HTMLBody; int att ...

Open/handle Word documents like SharePoint

Could anyone point me in the right direction when it comes to handling Word documents (.docx) on the server using asp.net. I know I can write to and read the .docx document using the API provided. But I would like to implement this like SharePoint does it. The user browses the web site, he is logged in, then chooses to make a new Word ...

Microsoft Outlook View Control

I am playing with the Microsoft Outlook View control, trying to understand its capabilities, but I'm not getting very far. It shows up at design time, but at runtime it just gives an "E_CLASSNOTREG" exception. How do I find out what class it is complaining about? I just created a winform project, added the control to the toolbox, and dr...

Error while creating excel apllication in vb.net

I recieve the following error: The server {00024500-0000-0000-C000-000000000046} did not register with DCOM within the required timeout. Can anyone lend some insight to the problem? Thanks. ...

Excel Automation

I used Microsoft.Office.Interop.Excel And genarate Excel file using SaveAs method.All are work correctly in computer Which install Office excel.My server does not contain excel . How can i run .Please help ...

Is it possible to rename Outlook Category programmatically?

We are developing Outlook 2007 add-in. For testing outlook category renaming I've added the following code block var session = Application.Session; var categories = session.Categories; var category1 = session.Categories[1]; //catefory1.Name is "Group1" before executing line below category1.Name = "TEST!!!"; Marshal.ReleaseComObj...

Problem With Setting Word Properties in C#?

I wrote simple code to open a Word file (.docx) and set properties for that file. This code do exactly itself job. But when C# opens Microsoft Word I should update all fields to see real values which are updated from my code! I want to know, what I do in my code to when Microsoft Word is open, all properties have real values and no more...

Can VSTO projects built using, for example, Microsoft.Office.Interop.Excel be run on machines without Office installed?

We're currently using a thing from SoftArtisans to generate Excel spreadsheets from data the mainframe FTPs down to our document server. The doc server has the .Net frameworks through 3.5 on it, as does my development box. The difference is my machine has Office 2007 as well. So, I built a service this morning with a filewatcher usi...

Removing Word table border using C#

Hi all, I wanted to perform specific table formatting by removing left, right, inside horizontal and inside vertical borders. I have recorded a macro for this and got the following VBA code. I tried to make the same using C# , but I could not find there properties like wdBorderLeft , wdBorderRight, wdBorderHorizontal or wdBorderVertica...

Performance issue with accessing Microsoft.Office.Core.DocumentProperties

Hi, I have a Excel COM addin which reads the CustomDocumentProperties section of a workbook. This is how I access a particular entry from the CustomDocumentProperties section DocumentProperties docProperties = (DocumentProperties) xlWorkbook.CustomDocumentProperties; docProperty = docProperties[propNam...

How do I use PIA to open an Excel workbook and save the first sheet to a text file?

I'm not too familiar w/ the PIA assembly's for Office interop (Office 2007) and via .NET/C#, I need to open a workbook and save the first sheet within it as a tab delimited text file. Can someone instruct me on how to do this? Thanks! ...

Exception while enumerating Outlook Items in C#

I'm trying to write an app that will monitor a few mailboxes and when mail is found grab some info from each item and then once I have a list of the items I can take the appropriate actions. But no matter how I approach it I'm hitting the Exchange enforced 255 RPC connections limit. I'm absolutely stuck as to what is causing the error ...

Updating External system from excel

It's obviously possible from a demo i saw earlier but didn't catch enough details I envision making a function call such as =MyRTDReverse("keyvalue", "fieldName", [AC51]) or =MyRTDReverse("keyvalue", [AB51], [AC51]) // where AB51 has the field name and AC51 has the field value etc. where updating the value in cell AC51 triggers...

Trying to do Office Automation with Excel 2007, but keeps using Excel 2003

Environment: Windows XP machine Both Excel 2007 and Excel 2003 installed (in that order, not chronologically). C# 3.5 Problem: When I use the PIAs to do some Office automation, I use the following line of code: var excel = new ApplicationClass(); The PIA's version specifically refers to it as Excel 12. C:\WINDOWS\assembly\GAC\Micro...

Reading and checking windings symbols in a word document from C#.NET

I'm new to .NET and have a basic question. I have a word document in which some windings symbols(character code=168 and character code=120) have been inserted. I need to parse the document and read and check which symbol has been used. I know that symbols are inserted using the Range.InsertSymbol method, but how do you read these symbols...

How to set Outlook contact "Notes" Property from .NET

I need to programatically Insert a contact to outlook Contact using C# application. I am using the Microsoft.Office.Interop.Outlook.ContactItem Object. I am able to set name, email, phone, etc. However, it does not seem to have a property for "NOTES" How can I set the notes for the outlook contact? Here is the code I am using: ...

How do I add custom properties to a Word doc with .NET 4?

Using .NET 4, how do I add custom properties to a document? I'm assuming it goes something like this: WordApp // an instance of Microsoft.Office.Interop.Word.Application .ActiveDocument .CustomDocumentProperties .Add...? I cannot seem to find documentation for this that applies to .NET4/interops v14. ...

Outlook 2007 from C# - COM exception, TYPE_E_LIBNOTREGISTERED

I'm trying to make a program that would open new Outlook 2007 message. I've referenced from COM tab Microsoft Outlook 12.0 ObjectLibrary. These items showed up in references in VS: Microsoft.Office.Core Microsoft.Office.Inerop.Outlook Now I try to invoke following code: var _outlookInstance = new Microsoft.Office.Interop.Outlook.Ap...

Microsoft.Office.Interop.Word documentation

I need to use the Microsoft.Office.Interop.Word namespace to extract if a Word document contains macros, and which ones. The MSDN documentation for this namespace doesn't give much information compared to the documentation on other .Net classes. Where can I get more informations about this namespaces (examples, complete documentation, et...