word

How to work on MS Word [.doc] files in c# to edit,create or do changes to it..

Hi.. How to create, edit or save a word file using c#.net. Plz suggest me the libraries and necessary tools needed to work on Word files. I need solutions for the below questions: How to access and read and interpret word[.doc] files in .net? How Code is to be intergrated onto the source file? How to represent this word file in a...

Possible to determine if an Word doc or Excel spreadsheet has a macro included?

When reading the binary of a Word or Excel doc into memory, is it possible to inspect the data to determine if a macro is built-in to it? ...

VBA tab strip macros in Word 2003 lost in Word 2007

At wife's workplace, they use a Word template file with a customized strip of editing commands in MS Word 2003. This includes some macro VBA commands to create customized tables and stuff. They want to migrate to Word 2007, but the strip of commands does not follow and they cannot find it. Any ideas how to migrate a strip of commands ...

C#: Opening a Word File in a FileStream for reading while it is opened in Word

I am trying to open a Word file for reading using a FileStream in C#. I hacked a quick sample application which consists of a textfield and a button to trigger the creation of the stream. The sample Code to open the file is the following: if (File.Exists(this.TxtPath.Text)) { Stream s = new FileStream(this.TxtPath.Text, FileMode...

How to read a file and get words in C++

I am curious as to how I would go about reading the input from a text file with no set structure (Such as notes or a small report) word by word. The text for example might be structured like this: "06/05/1992 Today is a good day; The worm has turned and the battle was won." I was thinking maybe getting the line using getline, and then ...

Find First Word matching from Given Text - Regex

I want to find First Word matching from Given Text and replace with another word, using Regex. Consider following string as an Example Text Which type is your item? i suppose that the item isn't a string, if so you can override ToString() method in the item class and use the jayant's code. I want to search first "item" w...

How can I automatically extract highlighted text in MS Word 2010 to a new file?

How can I automatically extract highlighted text in MS Word 2010 to a new file? The trick is I don't just want the highlighted text to be extracted. I what the whole page in which there is one or more words highligted to be extraced to a new document. I have a 300 or more pages document with some pages (around 50) that have some words hi...

Using interop to do a Word mailmerge using C#

I am trying to automate a mailmerge to print mailing labels with C#. I've created a Word template containing the label layout, but when I try to use interop to set the DataSource I am having issues. There are 2 ways I can go about this, either through accessing a SQL table or importing from an Excel spreadsheet. I've had mixed luck in...

How to get CSS background images to show up in HTML files opened by Word?

Hi all, My question is specifically what I'm after, but I'm also interested in 'general rules' around how to preserve styles when opening an HTML page in Word. More information on my context follows. The HTML file being opened in Word has <link ... /> elements including stylesheets. everything displays normally in a browser. So far I ...

what is the difference between doc.Content.Text and doc.Range(start, end).Text

Could you please explain what is the difference between doc.Content.Text and doc.Range(start, end).Text Actually, if I extract a string like doc.Content.Text.SubString(start, lenofText) and if I do the same with doc.Range(start, start + lenofText) I get correct result for doc.Content.Text but incorrect result with doc.Range ......

Using MS Word to directly query a db for mail merge

Currently, I'm using Excel 2002 with a ODBC connection to query an Oracle DB by User ID # and to return a set of parameters such as Name, Address, etc. to fill a mail merge form in Word 2003. I wanted to know where I could automate this process to the point that I would open up Word, be prompted for the User ID and being able to have the...

word document in opencv

I need to access a word document with an image and then process that image for patterns. Is there a way to read a word document and store it as IplImage in opencv? ...

Error automating Word on Test Server

I am trying to open a Word document from a .Net web application. The code (in brief) contains ... using Word = Microsoft.Office.Interop.Word; using System.Reflection; and, the code that actually creates the document includes: object oMissing = System.Reflection.Missing.Value; object oEndOfDoc = "\\endofdoc"; // \endofdoc is a predefi...

Interop Word - Delete Page from Document

Hi, What is the easiest and most efficient way to delete a specific page from a Document object using the Word Interop Libraries? I have noticed there is a Pages property that extends/implements IEnumerable. Can one simply remove the elements in the array and the pages will be removed from the Document? I have also seen the Ranges and...

Write MS Word Doc using itextsharp library

Can I write MS Word document using iTextSharp library? If yes, please give me sample code. ...

HTML to Word Doc in ASP.NET

How can I convert HTML to Word Document in ASP.NET? Please tell me a free tool. ...

Splitting word file into multiple smaller word files using OLE Automation from java

Hi there, I have been using OLE automation from java to access methods for word. I managed to do the following using the OLE automation: Open word document template file. Mail merge the word document template with a csv datasource file. Save mail merged file to a new word document file. What i need to do now is to be able to open the...

Java API for converting MS Word file with fields, and start-up macro to PDF

I have a word file () which has many text fields and a startup macro, which, when word file is opened sets, values to fields from file properties ?! So basically, I need API that can convert MS word (MS Office XP) to PDF. It would be great if API had a startMacro function(), but I know that is not gonna happen. I have tried Apache POI...

MS Word list with sub-lists

I am using Interop.Microsoft.Office.Interop.Word.dll to dynamically build a Word document in C#. Does anyone have a code example how to create a bulleted list with sub-lists? ...

How to discover what codepage to use when converting RTF hex literals to Unicode

I'm parsing RTF 1.5+ files generated by Word 2003+ that may have content from other languages. This content is usually encoded as hex literals (\'xx). I would like to convert these literals to unicode values. I know my document's code page by looking for ansicpg (\ansi\ansicpg1252). When I use the ansicpg codepage to decode to Unicode,...