msword

Is there a DocumentAfterPrint event in MS Word?

I am working on a project where I need to return a word document back to a certain state after it is printed. I have found a DocumentBeforePrint event but I cannot find a DocumentAfterPrint event. Is it poorly documented or is there some other workaround that exists? ...

PHP - Get number of pages in a Word document

Is there a way to count number of pages using PHP for existing Word documents? I appreciate for the help. Thanks ...

How to extract RTF / HTML text from a Word document ?

Context : I embedded Word into a Winforms using the DSOFramer sample published by Microsoft. Now, I can write text with all formatting options of a Word document. Question : I can extract the basic text from the doc, using doc.Content.Text (doc is a reference to my Word document), but i can't figure out how I can get the text with forma...

How can I programmatically update the fields, like FileName, in the pageheader in an MS Word 2007 document?

The following code only updates the fields outside the page headers. ActiveDocument.Fields.Update I also asked the question on MSDN Forums ...

How do I check programmatically if any document properties of a MS Word 2007 document has changed?

For example, I want the Title fields in the body and the page headers of the document to be updated automatically whenever the Title field in the document properties panel is changed. I know how to update the fields, but I want to know the name of the event that will tell me when the document properties have changed. Your help will be a...

insert text after dynamicly created table in word using VSTO

How using VSTO and Word 2003 can I insert text after a table I've created? I have code like bookmarkDescriptions = (object)"bookmarkDescriptions"; Word.Range rangeDescriptions = aDoc.Bookmarks.get_Item(ref bookmarkDescriptions).Range; foreach (var item in items) { //Add a paragraph with some text Table descTable = aDoc.Tables.A...

Reading .docx in C++

I'm trying to create a program that reads a .docx file and posts it content to a blog/forum for personal use. I finally have figured out how to use libcurl to do (what I figured) was the harder part of the program. Now I just have to read the .docx file, but have come under a snag. I can't seem to find any documentation on how to do t...

retrieve MergeField values from mail-merged Word Document programmatically

I have a large collection of MSWord documents (approximately 40,000), which are the results of mailmerges (same main document, different data sources). One of the merge fields is a text field which could have the text "Yes" or "No". Is there an easy way to list which of the documents have that merge field set to the value "Yes"? (I'm...

How can i add endnotes to a word doc using Powershell?

Hello I'm looking for a way to search for a word in a word doc and add an endnote(special type of footnote) with a definition of the word as the endnote text. This would allow me to hover over that word and then the definition would pop up like a tool tip. I know i need to use reflection, but i'm new to the whole reflection thing and al...

C# WPF Open File and edit certain text

So let's say I have a program with just a text box and an okay button. The user types in whatever word he wants, and when he clicks ok, it opens a specific file called Test.doc and CTRL+F for the word "test" and replaces it with whatever the user entered into the text box. How can I open said file and replace instances of the word test w...

Macro to delete headings in Word

I have a WORD document with a number of H1 headings. I'd like a macro that allows me to delete all the contents from a specific H1 heading until the next H1 heading - essentially deleting the H1 section. Similarly I might want to delete from a H2 heading until the next H1 or H2 heading. ...

Automating Outlook and Word to create email message

I'm trying to create a Word email message that will be used as the body for an Outlook message. I've been looking at sample code from Microsoft here but this code falls over when trying to create the new word document at the wordApp.Documents.Add line: Word.Application wordApp = new Word.Application(); object template = Syste...

How to open word document at specific paragraph with poi ?

Hi All, Requirement is this ... We are reading word document and getting all annotation from that document, and we are sending this document to user, when user open the document that time document should open with some specific page specific paragraph. ( That specific page, paragraph location we can give it, I can give the org.apache.p...

Word Interop Not Working In A Scheduled Task

I'm currently developing a script that takes a Word document, opens it up in Word, and then prints the Word file as a PDF. Everything works great when run manually either on my machine or the server. The problem comes in when I attempt to run it as a scheduled task. One of the requirements is that this should be done nightly without an...

How to Create a MsWord TOC without automation?

I'm using Aspose.Words to construct a Word Document programmatically (C#) on a server. The dynamically generated documents can be imported by clients via a web interface. Everything is great except I'm unable to generate a TOC. I've already exhausted my options with Aspose. Updating TOC fields is simply not a feature that Aspose curr...

Word Ifilter installed on Windows 2k3 Server?

Does anyone know if the iFilters for MS Word are installed by default on a vanilla Win 2k3 server? ...

Converting large set of word documents automatically into xml, modify them and than convert them into latex, pdf, html

Having a set of about 400 Documents in word which are part of a Quality Management System Word is causing me a lot of grieve because a) it handles images in large doc poorly b) the layout gets sometimes busted c) it is cumbersome to configure the documentation for different clients. I can convert single documents by saving them as xml/...

Retrieving the COM class factory for component error while generating word document

Hello, I am trying to edit a word document from VB.NET using for the most part this code: How to automate Word from Visual Basic .NET to create a new document http://support.microsoft.com/kb/316383 It works fine on my machine but when i publish to the server i get the following error. Retrieving the COM class factory for compone...

Call UserForm on Save

Hi, How do I go about calling a userform in VBA when user clicks on the Save button in MS Word? ...

Read Only Custom Properties

I managed to add custom properties (metadata) for MS Word from VBA, but how do I make it read only so that it cannot be changed easily? ...