office-automation

Check for hung Office process when using Office Automation

Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? ...

VB.Net Automating MS Word for Spell Check Capabilities

An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the Office 12 objects what will happen on boxes which have Office 2003? This is in regards to ...

Outlook/Exchange - how to programmatically export users in distribution list?

How do I export all of the names and email addresses from a distribution list in Outlook using code? I have access to an Outlook 2000 or Outlook 2007 client. Ideally I would like the code to be in C#. ...

How do I programmatically open a MS Word document without invoking the Document_Open macro

I am trying to use Office Automation to open a word document. The problem is that I would like to open it without invoking the Document_Open macro. Is there a way to do this? The relevant line below is wordApp.Documents.Open() Imports Microsoft.Office.Interop Public Class WordFunctions Public Shared Function ConvertToDoc(ByVal fil...

OSS implementation for SMB - What are the best products to use?

I am implementing Open Source based solutions for a publishing company in SMB sector. Currently Iam implementing these solutions - Office Productivity Suite-Open Office Human Resource Management-Orange HRM Messaging / Email systems-Zimbra Database Management-MySQL, PostgreSQL ERP And CRM-SugarCRM Document Management,colloboration w...

How do I disable/remove menu item "PowerPoint Options" in PowerPoint 2007?

I'm trying to lock down PowerPoint and I can get rid of some of the commands by using some ribbon-customization xml and group policies. But I need to remove or disable two more options. PowerPoint Options - This button shows when you click on the Office icon This item is also available in Word (Word Options) and Excel (Excel Options), ...

Format Excel Chart Background using C#

I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!! It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make the background a lig...

Excel 2007 automation on top of a Windows Server 2008 x64

I’m well aware of the Microsoft support base article stating that it’s not supported to automate office products UI less. It seems that Windows Server 2008 x64 and Excel 2007 enforce the given statement. I’m running the following code in a NT Service (Local System account) OnStart method. All it does is Excel automation the way it’s wo...

Office Primary Interop Assemblies not working after installing 2007 compatibility pack

I had a C# program that did some Word & Excel automation and it used Office 2003 Primary Interop Assemblies. The way I deployed it was by including the Interops in the bin and I had my program reference it from there as opposed to referencing it from the GAC (not very professional, but it worked fpr years). Recently on 3 machines the off...

range : apply formatting to a sub section in the range.

I'm writing a piece of code in c# to generate a report in microsft word document. I have a table of wid 2 columns. I select the 2nd column by oMainTable.Cell(currentRowNumber, 2).Range Every time I have to write something in that cell I use the above code with the combination of the Text property ,InsertParagraph(),InsertAfter() etc ...

Can Visio's macro warning prompt be surpressed when automating in code?

I'm automating Visio 2003 from a VB.NET app. My code looks like this (with the uninteresting stuff removed): Dim objApp As New Microsoft.Office.Interop.Visio.InvisibleApp objApp.Settings.ShowFileOpenWarnings = False Dim objDoc As Microsoft.Office.Interop.Visio.Document objDoc = objApp.Documents.Open(VisioFilename) I've found that the...

OLE automation - WORD tabels (Delphi)

Hi, I'm trying to make tables inside tables in WORD. of course in finall program it will be dinamical, which is not in this sample. Here is my sample code. var aTable, bTable, cTable : OLEVariant; begin m_WordApplication := CreateOleObject('Word.Application') ; m_WordDocument := m_WordApplication.Documents.Add; aTable := m_W...

Excel change chart formula

I'm currently generating Excel-documents using the Office Object Model. I have a problem with editing charts. In a template file I got a bar-chart which uses the following source: 2008 2009 2010 A 10% 25% 15% B 20% 25% 35% C 30% 25% 45% D 40% 25% 5% The chart has the following formula: =she...

Automation for Generating Reports

We are using Stata to combine and analyze data for all of our agencies in a district each month. I'd like to somehow create reports of the data analysis automatically for these monthly reports. The report includes a summary table of the reported indicators, a couple of graphics of the key indicators, and an analysis table showing stati...

How to access an inner merge field using c#.net

Hello all, I am working on ms word automation using c#.net . I am aware of how to access a merge field, which is created in word, using c# .But my issue is how to access a nested merge field .For example : {INCLUDEPICTURE "{IF TRUE"{IMAGE_PATH}"}"\d} So here when I go through each merge field present in the word document, it is selecti...

How to read text that is present in text box of MS word document?

Hi, I have an word document which I want to convert to text (.txt) file programmatically. I am using C# for this. I am able to read paragraphs and tables from word document and convert them to text. There are some textboxes in the word document and those textboxes contain text that I want to read and put them in text file. My problem is ...

Call was rejected by callee PowerPoint Automation

Hi, I have a commandbar model which automates powerpoint. i recently faced a strange problem that when powerpoint is opened through my application, and the data is being loaded through my application to populate the menu, if a user right clicks on powerpoint i get the error message: "Call was rejected by callee powerpoint" how do i re...

How to build form completion/document merge application with Winforms or WPF?

I need to build an application that accepts user input data (such as name, address, amount, etc.) and then merges it with a pre-loaded document template (order form) and then prints this merged document. I can use Windows Forms or WPF for this project. Any suggestions on how best to approach this? I'm experienced with Winforms develop...

Communication between Outlook addin and Program Automating Outlook

I have an application that uses the automation interfaces to Microsoft Outlook to create a mail message and then after it is sent save an archive of that email message in my application. I am hitting issues with a number of the third party encryption addins because by the time the Sent event fires what is passed to me is the already enc...

MS Excel automation without macros in the generated reports. Any thoughts?

Hello! I know that the web is full of questions like this one, but I still haven't been able to apply the answers I can find to my situation. I realize there is VBA, but I always disliked having the program/macro living inside the Excel file, with the resulting bloat, security warnings, etc. I'm thinking along the lines of a VBScript th...