Questions tagged [office-interop]

Office Interop is the layer using the COM Interop that allows .NET or C# to communicate with standard COM objects and libraries.

Office Interop is the layer using the COM Interop that allows .NET or C# to communicate with standard COM objects and libraries.

3602 questions
7
votes
4 answers

How can I change the font color of a TextRange in PowerPoint from C#?

I created a PowerPoint presentation using C#: PowerPoint.Application powerpointApplication; PowerPoint.Presentation pptPresentation; PowerPoint.Slide Slide; // Create an instance of PowerPoint. powerpointApplication = new…
pesten
  • 71
  • 1
  • 1
  • 2
7
votes
5 answers

Why doesn't Word "come to front" when we activate it?

Our winforms application interacts with MS Word and we run this code when a document is generated and we want to show it in Word in front of our application: [setup w as a Word interop object] w.Visible = True w.Activate() When rolled out to XP…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
7
votes
3 answers

Change the text color of the chart title in a PowerPoint Histogram chart

I am trying to change the text color of the chart title of a histogram chart in PowerPoint. Here is what I do: var colorFormat = chart.ChartTitle.Format.TextFrame2.TextRange.Font.Fill.ForeColor; colorFormat.RGB = ...; //…
Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
7
votes
3 answers

Invoking Word for rtf to docx conversion

I have a need to routinely programmatically convert *.rtf files into *.docx. Manually, this works just fine with Save As inside Word 2007 ... the resulting docx behaves just fine. Programmatically, I can't get it to work. What I tried is…
GregA
  • 91
  • 1
  • 1
  • 5
7
votes
3 answers

Access return value from VBA Function in .NET?

I have the following code in VBA (which resides in an Excel 2007 Workbook): Public Function Multiply(a As Double, b As Double) As Double Multiply = a * b End Function If I invoke Multiply from other VBA code, it returns the correct value. …
Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64
7
votes
1 answer

How to hide pdf importer popup in word automation

When I open a PDF file with Word automation, it show a dialog that ask me to confirm the convertion (With a "do not show again" checkbox). Word will now convert your PDF to an editable Word document. This may take a while. The resulting Word…
Kalten
  • 4,092
  • 23
  • 32
7
votes
1 answer

How to programmatically create a powerpoint from a list of images

I've seen this question: Creating PowerPoint presentations programmatically, but that question asks "Can you?" to which the answer is "yes". But I'm asking "How?" and specifically "From a list of images?" Here's what I do to break a ppt up into…
user773737
7
votes
1 answer

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:…
Jacob Adams
  • 3,944
  • 3
  • 26
  • 42
7
votes
3 answers

Making binding redirects work for office add-ins

I'm using Microsoft.Bcl.Async in my Word addin, my addin is compiled as an exe (test_addin.exe) file, that is loaded as an assembly from Microsoft Word, when I start the executable directly, everything's working fine, but when I run it from Word,…
animaonline
  • 3,715
  • 5
  • 30
  • 57
7
votes
3 answers

Excel automation: PDF export causes "Printer setup" popup

I am developing an application for automatic Excel to PDF generation. Every now and then (and without any apparent cause, the following popup comes up while the program runs: Print driver host for 32bit applications stopped working. and, shortly…
F.P
  • 17,421
  • 34
  • 123
  • 189
7
votes
2 answers

How to read merged cell from word document

I am getting the below exception while reading the merged cell. "Cannot access individual rows in this collection because the table has vertically merged cells." My code is, foreach (Row aRow in doc.Tables[i].Rows) { foreach (Cell aCell in…
Aslam
  • 93
  • 1
  • 4
7
votes
5 answers

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…
rold2007
  • 1,297
  • 1
  • 12
  • 25
7
votes
0 answers

Why does systemprofile need Desktop folder to open excel file

We were unable to open an Excel Workbook with ASP.net before creating a folder named "Desktop" in the systemprofile Folder. The solution was to create a folder named "Desktop" in C:\Windows\SysWOW64\config\systemprofile\ Error…
Matthias
  • 1,386
  • 3
  • 24
  • 59
7
votes
1 answer

The type 'T' is not compatible with the type 'T'

I have two libraries written in C# that I'd like to use in an F# application. Both libraries use the same type, however, I am unable to convince F#'s type checker of this fact. Here's a simple example using the Office interop types. F# seems…
Dan Barowy
  • 2,270
  • 24
  • 35
7
votes
2 answers

Can Microsoft.office.interop.word.dll work without installing office?

My ASP.Net-C# application works with mailmerge and the dll by name Microsoft.Office.Interop.Word.dll V14.0.0.0. All is well on my desktop (where office is installed). However when this application is deployed on the production machine, the following…
Vaishali Bulusu
  • 151
  • 2
  • 5
  • 10