Questions tagged [word-interop]

Word Interop is part of COM Office Interop. It allows .NET (VB or C#) to programmatically interoperate with the Microsoft Word application and documents, and communicate with other COM objects and libraries.

Useful links:

Related tags:

95 questions
3
votes
3 answers

Word VSTO Add-In: Get Working Area Coordinates / Rectangle on Screen

Using the VSTO Word Interop libraries, how can you get the screen coordinates / rectangle of the main "Working Area"? That is Left, Top, Width and Height. This image quite nicely shows the area I am looking for highlighted as "DISPLAY" - that is…
JDR
  • 1,094
  • 1
  • 11
  • 31
2
votes
1 answer

How to insert table in Word without clipboard using vb.net

Currently I'm working on improving a translated Word VBA code in VB.net. The program processes 200+ Word documents. So far, the program is running OK. I have an issue with inserting a table that contains images and text (from a template, wTemp) at…
rtO
  • 123
  • 1
  • 10
2
votes
1 answer

Symbol in added Watermark isn't correctly shown in C# Word Interop

My program has a function to add a watermark to word files, but a symbol 'Ⓒ' is not shown correctly, just a square like the attached file.(it's rotated). I guess I have to write a line of code to use these symbols, but I cannot find it. Can anybody…
LFLJM
  • 65
  • 10
2
votes
0 answers

C# Word Interop - Open a .pdf without the conversion prompt

I am using the Word Interop and wish to open a .pdf file and let word automatically do the conversion. I have the following properties set. var wordApp = new Word.Application(); wordApp.DisplayAlerts =…
Ryan Thomas
  • 1,724
  • 2
  • 14
  • 27
2
votes
1 answer

Insert and run macro into word using interop in c#

How can I insert and run a macro into a word document using Interop in c#?
Manohar
  • 31
  • 1
  • 6
2
votes
1 answer

How to write Text directly in a Word Textbox using C#?

I want to write some text to an existing word textbox using C#. Actually nothing happens and I don't know why. Maybe someone can help me? My method: Microsoft.Office.Interop.Word.Application oWord = new…
rejoin14
  • 57
  • 1
  • 6
1
vote
1 answer

doc.Activate() set to an null reference in c# for Microsoft.Office.Interop.Word.Application word

i used Microsoft.Office.Interop.Word.Application word to convert word file to pdf file.This is perfectly working in my local iis.But when i add this to cloud server,It gives me a this error. [NullReferenceException: Object reference not set to an…
hotflix
  • 41
  • 4
1
vote
0 answers

Why does Microsoft.Office.Interop.Word uses Aspose instead?

Might gonna be a silly question: I'm using C# and Microsoft.Office.Interop.Word and I'm trying to open a Word document from OpenFileDialog to convert it to PDF (without any changes) but my code decides to use Aspose.Words instead and creates a 134…
Oliver
  • 11
  • 1
1
vote
1 answer

Optional ref parameters - Microsoft.Office.Word.Interoop

As far as I know, optional ref parameters aren't available in C#. Overloading is the closest you can get. You also have to pass ref parameters with ‘ref’ keyword. At least that’s what I thought when I found this piece of code: var doc =…
Piotrek
  • 169
  • 3
  • 17
1
vote
1 answer

Word Interop Add Document Property Field to Table - "System.Runtime.InteropServices.COMException: 'This command is not available.' "

I'm trying to add a field for a custom document property into a table in a Word document using the Word Interop. However, when I do this I'm getting an error: "System.Runtime.InteropServices.COMException: 'This command is not available.'" I've…
Josh Lowe
  • 13
  • 3
1
vote
2 answers

How to quickly fill a table in a word document with many entries?

I am using Microsoft.Office.Interop.Word and want to output a given database as a table in a Word document. But after my first attempts (example below), I quickly noticed that the time to iterate over each table row increases rapidly with the number…
lkjasd2
  • 64
  • 1
  • 5
1
vote
0 answers

How do you automate "keep lines together" on two rows of a Microsoft Word document table using C# Word Interoper and self-hosted agent (Windows)

My code creates a 1 column, 2-row table. Then, my code manipulates the existing rows. My goal is to select the two rows and do the equivalent of these manual commands in Word: Home -> Paragraph -> Line and Page breaks -> Keep Lines Together The…
VA systems engineer
  • 2,856
  • 2
  • 14
  • 38
1
vote
0 answers

Word Interop: can't group shapes

I create 2 shapes (textbox), then i want to grop it. Shapes are selected but not grouped. I have no idea how to do this... Here is my code Word.Application wordapp = new Word.Application(); Word.Document doc =…
edward
  • 11
  • 1
1
vote
0 answers

saving word document as pdf using Interop results in COMException: command failed

I have an ASP.NET MVC app which application pool is configured to run as a custom identity account, for example, MyDomain\MyUser. I have a problem when creating a pdf file from a word docx file: I get a "COMException command failed" when trying to…
Willy
  • 9,848
  • 22
  • 141
  • 284
1
vote
1 answer

ASP.NET: Modify and download docx file

I have a docx file which I would like to modify according to web user input. So, after the user submits the form on the web page, I need to modify the original docx file, and then download it to the user. I try to store the original file as a…
szkup
  • 82
  • 10
1
2 3 4 5 6 7