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
1
vote
0 answers

Error when writing array to excel

I have been using this same routine for over 1.5 years with no problem then suddenly today I get the following error: Exception from HRESULT: 0x800A03EC My code reads an excel range into an array processes the array then puts the array back into the…
perryni
  • 35
  • 2
  • 5
1
vote
1 answer

Issue with SentOnBehalfOfName

i'm stack with Outlook issue where i want to change Email Sender. I want to send all emails from Outlook with one sender. When i change sender from Outlook it works fine but when i change it from Outlook plugin it's not work. I'm using following…
masta
  • 69
  • 1
  • 13
1
vote
1 answer

COMException (Catastrophic Failure) while accessing BeginConnectedShape and EndConnectedShape of nested connector shapes

I'm creating a PowerPoint AddIn, which is supposed to read information from an external file and integrate that information into the current slide which contains shapes, mostly textbox shapes and connector shapes connecting the text boxes. Each…
user656588
1
vote
1 answer

Office ribbon gallery control: How to achieve grouped items

I'm now developing an add-in targeting PowerPoint 2010 and 2013. According to this MSDN page, gallery has only item and button as children, and all tutorials I could find online were involving only these 2 children. However, some galleries in Office…
nevets
  • 4,631
  • 24
  • 40
1
vote
2 answers

How to insert a page break at the end of a page

I need to insert a page break at the end of the first page. Below is the selection. I am trying to insert a new page, then insert the page break at the end of that page. object what = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToPage; object…
sharpiee
  • 55
  • 4
  • 11
1
vote
1 answer

Setting Range to start on the second page of a document

I need to change the Range of a table of contents so that i can start on the second page of a word document. Anyone can help me with setting the range? The code below is the range that i currently have, but this will generate the table of contents…
sharpiee
  • 55
  • 4
  • 11
1
vote
1 answer

Insert Table Of Contents at the beginning of Word Document

I have the table of contents code below. I need to put this on the second page of my document. The document is 15 pages long. To insert it on the second page, i will have to add a page break at the end of the 1st page, and then have the table of…
sharpiee
  • 55
  • 4
  • 11
1
vote
2 answers

Get UsedRange for one column only in Excel Interop

Using Microsoft's Excel Interop I am reading a spreadsheet. I have no problems getting the used range for the entire sheet, but I want to get the number of rows used for one column only. Here is an example of my sheet: As you can see, the used…
John 'Mark' Smith
  • 2,564
  • 9
  • 43
  • 69
1
vote
2 answers

Apply a ReceivedTime = Today's Date filter in Items.Restrict

I am trying to filter items in a folder using the code below: sFilter = "[ReceivedTime] > '9/20/2014'"; items = InboxFolder.Items; // Line 1 items = InboxFolder.Items.Restrict(sFilter); //Line 2 When line 2 executes, it returns the items of…
Pradip
  • 1,507
  • 11
  • 28
1
vote
1 answer

Adding pictures to slide puts them in different location depending on slide template

My code to add a picture to a slide is as follows: PowerPoint.Application ppApp = Globals.ThisAddIn.Application; PowerPoint.SlideRange ppSR = ppApp.ActiveWindow.Selection.SlideRange; PowerPoint.Shape shape =…
JKennedy
  • 18,150
  • 17
  • 114
  • 198
1
vote
0 answers

Save powerpoint presentation without image compression

I am using the powerpoint interop library to programmatically open a powerpoint presentation, make changes to it, and then save it. The problem is when I call the presentation.save() method, it compresses most of the images in the presentation. Is…
hello_world
  • 442
  • 3
  • 7
1
vote
1 answer

compare Shape object serialized out as xml with PP Shape object

I have object Microsoft.Office.Interop.PowerPoint.Shape and I need to know if it is related (the same as) to object DocumentFormat.OpenXml.Presentation.Shape. Maybe I can compare ID's? But to me looks like OpenXml.Presentation.Shape has a different…
1
vote
0 answers

Embedding or copying locally interop?

I've run into a few troubles with the interop dlls. When I use embed interop in the references true, then the program functions, but if I say "don't embed instead copy locally" the dll isn't in the bin directory and thus the program says file not…
Thomas
  • 2,886
  • 3
  • 34
  • 78
1
vote
2 answers

filter excel sheet

I have an open excel sheet that I have just written to, using Microsoft.Office.Interop.Excel. Now I want to remove lines which have certain values in certain columns. For example, removing all the lines that have the text blah blah in the column…
Yona
  • 269
  • 1
  • 5
  • 18
1
vote
1 answer

Can't open Office document with Interop

Code: ApplicationClass projectApp = new ApplicationClass(); if (projectApp.FileOpen(path, true, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,…
Matheus Simon
  • 668
  • 11
  • 34