word

VSTO find ContentControls of a Word Document

Is there a way to find all ContentControls of a WordDocument (including ContentControls in Headers, Footers, TextBoxes ...) using VSTO? Microsoft.Office.Tools.Word.Document.ContentContols returns only the ContentControls of the Main-Document, not the one inside the Headers/Footer. ...

strip word document for formatting but not images?

I need to add a bunch of word documents to a wiki but want to clean up the resulting html so ideally I have text and image tags... Anyone up for a challenge? :o) It's ok if the solution involves using a text editor and doing some "gymnastics" on it. ...

Use PHP to create a DOC file on a Unix Box based on an HTML webform selection

Hello, I have an HTML file which contains a webform with multiple questions which have a YES / NO responses. If the question has a YES answer, I would like a predefined ( per question ) section of text to be written to a DOC file on the server, but only AFTER the submit button has been pressed ( this way, if the user changes their mind...

Wrap Text inside fixed Div with css or javascript ?

Hi, I have tinymce editor(textarea) and one div. Whenever i type inside the text editor, it shows at the preview div which is (200px) in real time which is looks alike stackoverflow preview. What I want to achieve is, if we type one words without space and if exceed 200px, I want to wrap it to the next line. I tried to find it and I...

Problem with saving .doc as .xml

What I'd like to achieve is to force MS Word not to split specific strings when saving .doc or .rtf file as .xml. For example, now from something like: Something: ***TABLE_NAME.COLUMN_NAME*** or Something: AAATABLE_NAME.COLUMN_NAMEBBB or anything similar I get: <w:p wsp:rsidR="00537583" wsp:rsidRDefault="00AF6BDF" wsp:rsidP="...

Position cursor at start/end of Word document

We are manipulating our Word 2007 documents from .Net using Word Interop. Mostly doing stuff with fields as in: For Each f In d.Fields f.Select() //do stuff with fields here Next This leaves the last field in the document selected. So, for the sake of neatness we would like to positi...

Itemized bills in Word

I'd like to generate itemized bills for a non-profit as a Word mail merge. Right now, the source data is stored in Excel in a pivot-table-like structure (this wasn't my idea) with two cells (owed and paid) per item type per customer. (Each customer has one row, and each item type has two columns). The existing data is in this struct...

Building Web Content and Word Documents

What is the best tool for breaking down Word docs into a series of strong, em, a, br, and p tags. I'd like to drop all other info. The built-in Word 2007 "Filtered" HTML "Save As" doesn't work that well. Other ideas? ...

Response.Redirect Word Document Glitch?

I come a desperate and broken man.... I'm developing a corporate intranet / search engine application. When users open a document, my ASP.NET code records the action to the Windows Event log, and then issues a "Response.Redirect" (for security/audit). Process is: - User clicks LinkButton "Open document My Document.doc" - Postback ...

Reading a word 2007 table using C#

Hi, I am relatively new in Word 2007 programming. Pardon me if this question is already asked. I would like to read a word table and its child cells and extract that text out in C# (VSTO tools). I would like to build out an xml from the data extract later. Please guide me if anyone has done something of this sort. Would really apprecia...

Word Add-In CustomizationContext - how to set it to Add-In itself

When Word Add-In adds some context menu it is expected to set CustomizationContext (otherwise Normal.dot is affected). There are multiple options to what can be a CustomizationContext. And as the following article states it can be Add-In itself - just scroll to the following list bullet: A component object model (COM) add-in, also k...

How to convert HTML file to word?

I've got a requirement where I need to save HTML documents in memory as Word .DOC files. Can anybody give me some links to both closed and open source libraries that I can use to do this? Also, I should edit this question to add the language I'm using in order to narrow down the choices. Thanks! ...

Need a program to reverse the words in a string

I asked this question in a few interviews. I want to know from the Stackoverflow readers as to what should be the answer to this question. Such a seemingly simple question, but has been interpreted quite a few different ways. ...

PHP Bold some words in a string and remove some unbold words

Hi, I am creating an Image Search Engine. Currently, my script does bold the matching words on the keyword. But, some keywords are too long just like the followings. When I search for shah rukh khan, there is an image with the following keyword. 25216d1235653089 shahrukh khan s wallpaper shah rukh actor As you see, the above k...

Optimizing word count

(This is rather hypothetical in nature as of right now, so I don't have too many details to offer.) I have a flat file of random (English) words, one on each line. I need to write an efficient program to count the number of occurrences of each word. The file is big (perhaps about 1GB), but I have plenty of RAM for everything. They're...

VBA Word Macro doesnt recognize whitespaces or wildcards

Hi guys, I have a VBA Word Macro that gets words from .txt list and color highlight them in a word .doc document. The problem is that the script ignores whitespaces and wildcards from the .txt list. I insert the word "wit" but it also changes words like witHIN , witCHE, etc. I tried inserting wildcards in the .txt file, like or usi...

OpenXml SDK - Image Reuse

Hi, I am creating a word document based on a template. The template contains a image in the header section which I would like to re-use elsewhere in the document. The image is stored in the package -> word/media/myImage.jpeg so I need to somehow add a relationship to my each section that I wish to display the image again. I have attem...

How to write a custom spell checker for Microsoft Word?

I want to write a spell checker for Word 2003 and 2007 preferably using Microsoft's own CSAPI which will enable my spell checker to work in the same way the built-in spell checker works. I did a bit of research and found out that "developers who are interested in implementing a CSAPI spell check engine and lexicon, or only an add-in lexi...

MySQL check how many times a word appears inside a table cell

I want to write a query to select from a table all rows with the word "piggy" in a column called Description. SELECT * FROM table WHERE ...? Thank you! ...

Word Document : List of Heading with associated next paragraph (for executive summary list)

I refer to the link below which offers a very good solution [ using GetCrossReferenceItems(wdRefTypeHeading) ] to generate a list of all headings in the document. However, I would like to take this a step further and include the first paragraph following each heading in the sumamry table. The intended use is to give the reader an overv...