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
2 answers

Multiple InfoPath interop automation instances

I am trying to automate multiple parallel instances of Office InfoPath 2010 via a windows service. I understand automating Office from a service is not supported however it is a requirement of my customer. I can automate other Office applications…
7
votes
8 answers

Alternative to Office Interop for document generation

At the moment we're using office interop to generate documents from templates in office 2003 (word, excel & powerpoint). This seems to be rather frowned upon (see office-interop-with-64bit-windows-in-asp-net) and whilst it works fine I would be…
ohnoesitsbroken
7
votes
1 answer

Save XLS Using Interop Excel

The Current Setup: So, I can use the following code to save a file as an XLS: _myWorkbook.SaveAs("FileName.xls", Excel.XlFileFormat.xlWorkbookNormal) I can also use the following code to save a file as an XLSX (Since I use Office…
Onion-Knight
  • 3,477
  • 7
  • 31
  • 34
6
votes
1 answer

How do you pass the owner window to Show() method overload?

I'm working on an Excel add in that opens a winform after the user clicks a button on a ribbon bar. This button needs to be non-modal so that the user can still interact with the parent window, but it also must remain on top of the parent window at…
hughesdan
  • 3,019
  • 12
  • 57
  • 80
6
votes
1 answer

What is the difference between Microsoft.Office.Interop.* version 12 and 14?

I have installed Visual Studio 2010 and Office 2007. When I go to "Add Reference" and search for "Office Interop" I can see that each of the references appear twice with versions 12 and 14. I initially tried version 14 of…
Ozzah
  • 10,631
  • 16
  • 77
  • 116
6
votes
1 answer

How can I focus on a Word document I just opened through interop?

I am writing a simple Word Interop application which open a .doc file in background, changes bookmarks content, then make it visible to the user : var App = new Microsoft.Office.Interop.Word.Application(); var ParTemplate = (object)Template; var…
Larry
  • 17,605
  • 9
  • 77
  • 106
6
votes
3 answers

VSTO with .NET Core 3.0

I was wondering if the VSTO works on the new .NET Core 3 which supports COM Objects. A Project can be created with .Net Framework and then migrate it to .NET Core by modifying the .csproj file, but will be the VSTO compatible ? If not, is there an…
Aziz Khalledi
  • 63
  • 1
  • 4
6
votes
1 answer

Programmatically count number of characters/words/paragraphs with a specific style in a DOCX document

I need to programmatically count the characters and/or words and/or paragraphs which have been applied a specific known style in a DOCX document. I need to know 1) if this is possible and to 2) any hints as to where I can start to get going to solve…
andrerav
  • 404
  • 5
  • 14
6
votes
1 answer

C# Word Interop AccessViolationException when saving

I want to write a program which will read in a whole bunch of word 97 files (.doc) and save them as .docx files. I'm restricted to .Net 2.0. At this stage, I just want to get it working with my stub code - then I will write the GUI and logic to open…
Ozzah
  • 10,631
  • 16
  • 77
  • 116
6
votes
8 answers

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).…
Sathish
  • 869
  • 2
  • 13
  • 28
6
votes
3 answers

How to convert excel workbook to pdf without using excel interop library?

I have an xlsx file that includes charts each in sheets. I want to save it as pdf file. I made a sample using excel.interop: Application excelApplication = new Application(); Workbook wkb = excelApplication.Workbooks.Open(oSlideMaster._FILE_PATH, 0,…
Mennan
  • 4,451
  • 13
  • 54
  • 86
6
votes
3 answers

starting excel application with addins from c# application

I have a c# app and it needs to create an excel application & then open a workbook. The issue is I need a Bloomberg addinn to be loaded when excel opens. The only way I have found is in this post working example. This indeed starts excel and able…
mHelpMe
  • 6,336
  • 24
  • 75
  • 150
6
votes
3 answers

Does Primary Interop Assemblies ( PIA ) require Microsoft Office to be installed in the machine to work

Does Primary Interop Assemblies (PIA) require Microsoft Office to be installed on the machine in order to use? I have gone through so many confusing post/sites and am unable to arrive at a conclusion. I have a machine where Office is not installed…
Midhun Murali
  • 2,089
  • 6
  • 28
  • 49
6
votes
2 answers

How to develop Microsoft office word addin for 64bit version office in vs2010

I have developed an addin for word in vs2010.It's working cool in 32 bit version of office, but its not working on 64bit version of office .Searched a lot and found that For 64-bit Root\Software\Microsoft\Office\application name\Addins\add-in…
Dah Sra
  • 4,107
  • 3
  • 30
  • 69
6
votes
1 answer

Sending email from the specified Outlook Account

I am using Outlook2013 which has a number of mailboxes from both exchange and pop servers.(Rob@mydomain.com[default exchange], rob@somethingdifferent.com[POP], support@mydomain.com[exchange]) I am trying to use Outlook automation to send an email…
Rob
  • 111
  • 1
  • 3
  • 14