msword

Programmatically convert *.odt file to MS Word *.doc file using an OpenOffice.org basic macro

I am trying to build a reStructuredText to MS Word document tool-chain, so I will be able to save only the rst sources in version control. So far I -- Have rst2odt.py to convert reStructuredText to OpenOffice.org Writer format. Next I want to use the most recent OpenOffice.org (currently 3.1) that do a pretty decent work of generating...

Why saving of MSWord document can silently fail?

I need to change some custom properties values in many files. Here is an example of code - how I do it for a single file: import win32com.client MSWord = win32com.client.Dispatch("Word.Application") MSWord.Visible = False doc = MSWord.Documents.Open(file) doc.CustomDocumentProperties('Some Property').Value = 'Some New Value' doc.Save(...

What meta tag can I place inside my html file so that it opens that page in microsoft word automatically?

My question is related to this one: http://stackoverflow.com/questions/326941/is-there-a-way-to-generate-word-documents-dynamically-without-having-word-on-the My co-worker told me however that there are some meta tags you can place inside your html head section that will redirect the html and make word open that html page as a word doc...

CreateDispatch causes Vista to get all twitchy

I am creating an instance of word by calling CreateDispatch("Word.Application"). This works fine except in Vista it causes the dialog about the server being busy to come up and you have to keep hitting the "switch to" button several times. Each time you do it pops up the start menu until it finally opens word. Anybody know why and if the...

How to serve .RTFs

I support a web-application that displays reports from a database. Occassionally, a report will contain an attachment (which is typically an image/document which is stored in the database as well). We serve the attachment via a dynamic .htm resource which streams the attachment from the database, and populates the content-type based on ...

Problems starting a thread in a Word 2007 Ribbon Add-in

I created a Word 2007 add-in project in C# that works fine on my box and a fellow developer's box. When we try to deploy the software to a blank box though, Word crashes hard (no exception thrown) when we start up a background thread. Here's the relevant code, in the Ribbon.cs file: private void startThread() { StreamWriter fout =...

VBA WS Toolkit, how to get current File as Byte Array

Using VBA I want to send a copy of the current word document to a web service? How can is get the current document as a Byte Array? I know how to use the web service just not sure how to get the current file as a binary object to send? p.s. I have only been using VBA since this morning =) So simple answers are appreciated ...

Word Automation and the Running Object Table

I am using the ROT to find any active MSWord instances. In some versions of word the document does not get registered in the table, instead it is registered as the NORMAL template and so I can not find the document by it's title as documented by microsoft. Anyone know of a hotfix for this? ...

Possible to export content generated by a Web WYSIWYG editor to MS Word

Hi In our project we work a lot with both HTML and MS Word. The users create "documents" in their browsers and when they are finished they export these documents to MS Word using the DocX library (http://docx.codeplex.com/). This works fine when we only handle text. What we want to do now is to let the user format the text that is ente...

Trying to manipulate MS Word bookmarks using PHP and COM

I'm trying to manipulate some fields in a supplied Word 2003 document using the document's own bookmarks using PHP and COM but am getting an error which ever method that I use. If I try to call the Bookmarks directly to substitute the text I get an error: The range cannot be deleted. function testBkMrkDetails($word, $bookmarkName, $sub...

MS Word Office Automation - Filling Text Form Fields And Check Box Form Fields And Mail Merge

Does anyone have any good advice or experience on how to create an engine using C# (VB.NET is okay too) that is generic enough to handle most cases of MS Word text fields I need to fill with data I'm getting from a database? In short, I'm about to embark on this little Office automation excursion and I'm hoping a little bit of feedback ...

Word 2007, VSTO get default save location

From within my VSTO word code. I need to get the path to where the document was created from(new Document). In this case its a sharepoint document library containing some folders. so the value im looking fore is somthing like http://myserver/mysite/documents/folder/ Ofcourse the location is different from time to time. Word has the val...

Convert Word document [Multi Page] into JPEG File in C#

I want to convert the contents of word file [3 or 4 page document] into JPEG file in C#. I have tried using clipboard option, but it is converting only the first page. Please help me. ...

Handle File->New in Word 2007

I am writing a VSTO addin for Word 2007. When the user selects File->New, (or selects it from the quick access toolbar) I need to display a custom form instead of the standard new document dialog. How do I do this? I don't see an application event I can handle and I can't seem to find the buttont to add an event handler too. ...

Event when Word 2007 changes the theme

Is there an event I can register from my VSTO application that is fired when the theme of Word 2007 is changed? ...

New line formatting when using HTML file as Word file?

I'm writing a PHP application for a client that needs a pre-existing HTML page I've already created to be "exported" as an Word file. Simply, this is how it's done: if (isset($_GET["word"])) { header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=some_file.doc"); } This, of course, will ...

Checkbox control not working in Word UserForm (Word 2007)

I'm fairly new at this (VBA programming) so pls forgive me if my coding seems simplistic. I have a Word UserForm (Word 2007) with some checkboxes and 2 command controls - Ok and Cancel. When the form is activated from the macro menu or from an assigned icon the checkboxes don't work. However, the 2 command controls work. What I mean b...

How to find and replace programmatically in ENTIRE Word document

I have a Word document with text in tables and text outside tables. I want to find and replace in all the text, not just the text outside the tables. The content property of the document is just the "main story" and not the tables. I don't want to iterate through all the table objects. I just want to find and replace in all the text, jus...

Replacing Word's Open File Dialog in a COM Add-in

I'm writing a Word COM Add-in that replaces the Open & Save dialogs with my own. For the save dialog, I'm handling the documentBeforeSave event from the application events. This works fine. For the open dialog, there is no such event, so I'm currently handling the onClick of the Open... menu item, canceling the default handling. This...

Applescript to print Word documents

Is there a way to print all of the Microsoft Word documents (.doc) in a folder using AppleScript? ...