msword

Document.SaveAs method ?

A template report with extension *.docm will be shown to user, he will modify it, and when he click the save button. I want to write the modified the document as accessionID.docm at the specified folder. What must be the object FileFormat = ?? private void btnSaveDocument_Click(object sender, EventArgs e) { if (m_docFileName == Re...

How to stop server-generated Word .DOCs from saving with "_files" folders?

I have a Word .DOCument that's being generated by a (classic ASP) server. It's an HTML file that's being output as a .DOC using the application/msword content type. The document is generated fine, saves fine, opens up fine in Word, and is fully editable... The problem occurs on the next document save in Word. A folder is created in the ...

OpenXML: Creating reusable Content Controls with binding

I need to attach specific XML to a word document so the elements will show up in the right places. This I can do with OpenXML SDK. The thing is I want too be able to define the Content Controls already bounded in some sort of template so other people can create the real document template the xml will be attached to. Ok not sure people w...

How to prepare a Word 2007 document so that C# can pull data out of it semantically?

I have a friend who is writing a 400-page book in Microsoft Word 2007. Throughout the book he has 200 stories each which consist of numerous paragraphs. When he is finished writing the book, he wants to copy the text of each story that is embedded in his Word document into a database table such as: Title, varchar(200) Description, tex...

Problem with MS Word 2003 suddenly removing digital signature added for macro

We have a document which contains, checkbox (OLE), text form fields and drop down lists. The document is protected and allows form filling only. The behavior of MS Word is very inconsistent and sometimes the digital signature is removed on save. MS Word displays a prompt saying that the signature has been tampered and it will be remov...

Syntax highlighting in MS Word

Is it possible to create a plugin or addin for MS Word that allows a section of text to be selected and then a custom "Highlighting" function to be applied to it. I want this to all be within MS Word not a cut and past from another application. If possible, any suggestions on where I could find some direction on how to do this ( using ...

Replacing Content Controls in OpenXML

I need something as a placeholder. I at first looked to Content Control as a solution but I'm having some problems with it. I at first looked into adding CustomXML to the .docx but turned away from that because of the i4i lawsuit. Then I decided I would just plain change the text of the Content Control through OpenXML SDK 2.0 but even ...

insert date in a word document

Hi everyone, I'm working on a Word document which has a table on each page. Each table contains several occurrences of the word "Datum". By doubleclicking this word "Datum", this word should be replaced with the system date. And this date should be "frozen", i.e. it mustn't adapt itself when opening the document on a different day. ...

MS Word: How do I create Building Blocks efficiently?

I need to create a Building Block Gallery with defined Content Controls to make it easy for others to create word documents that would be ready to accept my data. I'm trying to make this as painless for the users as possible. I wanted to make sure all this would be professionally done and look good so I wan't to make sure all the Conten...

Word/Office Automation - How to retrieve selected value from a Drop-down form field

Hi, I am trying to retrieve the value of all fields in a word document via office automation using c#. The code is shown below however if the field is a drop-down then the value of the range text is always empty even though I know it is populated. If it is a simple text field then I can see the range text. How do I get the selected d...

Editing Word files stored in a Database

We want to store Microsoft Word templates in our database. Then we wish to allow the user to edit the template files and then store them back to the database. What is the best strategy to use in this situation? Is this possible if we have Word running in a separate process? i.e. not hosted in our application. If so would this involve mo...

Creating a Word document in Coldfusion - how to have pagenumbering?

I am creating a Word format .doc using the following code, then cfheader and cfcontent to serve. All is good but I need to be able to place dynamic information in the header (or footer), or automatic pagenumbering would be a second best option. How should I modify the code? <cfsavecontent variable="myDocument"> <html xmlns:w="urn:sche...

Programmatically search + replace in a .doc

If I'm given a .doc file with special tags in it such as [first_name], how do I go about replacing all occurrences of it with something like "Clark"? A simple binary replacement only works if the replacement string is the exact same length. Haskell, C, and C++ answers would be best, but any compiled language would do. I'd also prefer to...

Word Mail Merge from ASP.NET web application

What is the best way to do this. I dont have access to the database since it is firewalled. It needs to be done throught the web interface. I can generate a csv file and plug it into the word document, but it seems cumbersome to me. Is there any better way to do this? Thanks Edit:For future reference i ended up using a library called...

Remove MSWord formatting using ColdFusion Regex

We have a lot of data that contains nasty MS Word formatting like this: <!--[if !mso]> <mce:style><! v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:Tr...

How to handle text copy/pasted from Word

We have a textbox where users will be entering reviews. They should be able to do simple formatting things like bold, italics, lists, headers, etc... Our problem is that the majority of our users will most likely create their reviews in MS Word then copy/paste the text to our form. As you know, this can (and mostly will) cause problems w...

How do I modify the default styles in Word 2007.

How do I modify the default styles in Word 2007. I need to change the style "Intense Emphasis" from blue to red. Updating the Normal.dotm works well and good when I open up a new 2007 document, BUT when I open a 2003 document via Word 2007 the "Intense Emphasis" is still blue. How do I fix this? Do I need a macro? ...

MS Word macro to fix closest spelling error

I'm trying to create a fairly simple macro in Word 2010 using Visual Basic. All it needs to do is press Alt+F7 to select the closest spelling error, then press Enter to choose the first spelling suggestion, then press Shift+F5 to return to the previous edit point. I tried this: SendKeys "%{F7}" SendKeys "~" SendKeys "+{F5}" but the co...

Microsoft Word: Change Font of Characters Missing In Default Font

I am trying to use VBA in Microsoft Word to automatize highly repetative operations on large documents. The situation is this: I have a technical text containing a lot of special characters, e.g. ❨ (U+2768) and ❩ (U+2769). The text is chiefly typeset in Cambria, but some of the special characters are not found in this font. However, I ...

Problem with RMS and Websphere 6.1 32 bit

Hi, I'm facing a problem with Websphere and RMS, followings are what I have: Windows 2003, sp2, 64 bit, enterprise edition. Microsoft Office word 2003 sp3. The machine is connected to a domain, and I logged-in by a domain user (with email address). RMS client installed. RMS is worked correctly when trying to apply it from Word it self....