msword

Open Word Documents using Interop DLL without opening Word?

Hello Everyone, I have written an automated test which loops through a large volume of Word Documents and opens them individually in a single Word instance. My question is.. can I perform the OpenDocument() without an ApplicationClass instance? What I would like to do is run my test without having a visible instance of Word open. Possi...

Using Selection.Find in Microsoft.Office.Interop.Word to find tracked changes in a document

I am currently using the code below within a VB.Net application to find specific text in a Word document. The text is surrounded by symbols represented by the character codes in the .Text statement. The code below is working fine. The issue now is that sometimes the desired text within a document has been marked for deletion and appea...

Modify placeholder style for word 2007 citations.

I read that defined styles are located at C:\Program Files\Microsoft Office\Office12\Bibliography\Style I use ISO 690 and when I insert citation field placeholder for a reference in document, it uses the following format (source_number). But I need to change that to [source_number], replace () parantheses with []. Could someone experi...

Using VBA to parse text in an MS Word document

Hi, I was hoping someone could help with a MS Word Macro. Basically, I have a MS Word document which lists out several text files and specific pages of interest in each file. The file format is similar to: textdocument1.txt P. 6, 12 - issue1 textdocument2.txt P. 5 - issue1 P. ...

What are the best ways to convert MS word file to image or pdf preferably using java?

I want to convert MS word formatted documents to images and pdf. I am well versed with Java. I was looking for apis using which I can do the same. Can anyone please point me to that ? If you know the best alternatives even though they are for other languages , please update me about that. ...

Storing arbitrary meta-data in Microsoft Word document

I need to store custom meta-data in a Word document. The 'document properties' are limited to 255 bytes but I have data which is >> 10k We are using VBA to write a word extension to interact with our application and want to have our application data stored in the word document. The idea is that that the user can share just the word docu...

Replace text in Word Document with ActiveX?

Hi there. I want replace some string within Word Document using ActiveX and JavaScript, now I have something like this: var text = Selection.Text; Selection.Text = text.replace('somesting','somevalue'); But after that I loose all formaing. If I record macros in WinWord I get this: With Selection.Find .Text = "somestring" .Rep...

How do I minimize source control-deltas when changing Word files?

Is there something I can do or consider when working with Word files in source control/Subversion in order to minimize the size of the changes in the repository? Background For a project we have a Word document with our functional specifications with screen shots from a prototype in source control (Subversion). The Word file itself is ...

Export a Table of Contents to Word

Hey Can any One help me ? I am creating a table in C# using HtmlTextRender and i am getting the innertext and the css is not working in that when i show it in Ms Word and also i am getting Table Lines and td tr lines. Thanks in advance :) Kishh ...

Saving a word document as an image

I am using the below code to convert a Word Doc into an image file. But the picture appears too big, and the contents don't fit - is there a way to render the picture or save the picture to size? private void btnConvert_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtFileName.Text)) { ...

Automatic field update of current SVN revision for Word/Openoffice document

Subversion's "keyword" feature is great to automatically tag text files with the revision number. I'd really like to do a similar thing for Word and/or OpenOffice documents. I tried this with Word documents, by inserting a "fixed-width" keyword substitution into the "comment" document properties field. But it seemed to still corrupt the...

Word Macro - Insert picture as oShape?

Hi, I'm trying to write a macro where I press a button and a dialog window appear which lets me choose an image I want to insert to the document. I've managed to do this by this simple code: Private Sub btnInsertPicture_Click() Dialogs(wdDialogInsertPicture).Show For Each ishape In ActiveDocument.InlineShapes With ishape ...

RPC_E_SERVERFAULT when automating Microsoft Word

I'm creating word documents from templates (.dot) via Microsoft.Office.Interop.Word. The code below works on some templates but not on others: where it doesn't work it throws an RPC_E_SERVERFAULT exception. What is this about, what can be the cause and how could i fix it? (exception occurs at the second line) Code: w...

How can I get the filename of a Word document from C#?

I'm working on a MS Word AddIn (VSTO). The idea is that I work on a Word document and I send it somewhere. I have all the code I need except one thing: is there a way I can get the filename of the Word document I'm working on? (assuming that is already saved) ...

Copying wingdings (etc) from word documents to html text fields

When I write out some text (standard English, no fancy characters) in Word using Windgings as a font, copying the text and pasting into an html textfield results in the OS's "I don't know what character this is" characters (little squares on Windows). It seems that changing the font (what should be a display-only property) is preventing...

Importing HTML in Word 2003 using C#

I am trying to export the web page content into Word. In word 2007 the datas are displaying in correct format. But in case of word 2003 the display format is not correct. What is the reason for this? What should I have to do to rectify this? I am displaying a textbox and some check box controls which is in the form of Matrix. Actually i...

Programatically get pages count in Microsoft Word documents on linux

I need to get pages count from word documents. I've tested many libraries and scripts (apache poi, perl scripts, some application for linux and some more) and the only working solution was to install Microsoft Office with Wine and access OLE with perl. I've managed to do it but it seems I can't use it on server due to licensing problems....

Problem writing HTML content to Word document in ASP.NET

I am trying to export the HTML page contents to Word. My Html display page is: What is your favourite color? NA List the top three school ? one National two Devs three PS And a button for click event. The button click event will open MS word and paste the page contents in word. The word page contains the table property ...

Add Header and Footer to Word Document from ASP.Net

Is there any way to add Header and Footer Info to Word. I am currently writing HTML contents to word file using ASP.Net. ...

Word - Insert data from registry into predefined bookmarks

Hi! I've got data in the registry under Current User which I want to add into predefined bookmarks in Word documents. Now, the thing is, I want the exact same macro in every single Word document and have the macro skip the step if it can't find the predefined bookmark. I've got this code already where I need to predefine an array of th...