msword

Adding a custom file format to the Word 2007 save as dialog

I want to add the option to export to a new file format in Word 2007. Ideally it would be nice if the option could be another file format in the Word 2007 Save As dialog that the user could select in the file format dropdown box. Although I have a lot of .NET experience I haven't done much development for MS Office. At a high level what...

Disable or Override Ribbon/CommandBar commands in MSWord using VBA

Hi There First of all I'm going to state right out that I've never worked with VB in the context of coding macros before - my skills lie in other areas (PHP, Javascript, getting there with C#, etc). However, I've been asked by a colleague to lock down a document so that the user cannot change font faces, sizes or colours but does still ...

How can I insert a footer in word?

I'm using this to open an RTF in Word and save it as a PDF: Object oMissing = System.Reflection.Missing.Value; //null for VB Object oTrue = true; Object oFalse = false; Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); ...

VBA - weird problem with control font on UserForm

I have a VBA UserForm (in a Word document), that has some CheckBox controls inside a Frame control. All of my CheckBox controls are set to use the Tahoma font (the default for controls), but one of them is showing as Verdana. That is, it says Tahoma in the properties dialog, but the font actually used to display the text is Verdana (bot...

is it possible to automatically purge a Word document of all scripts and other malicious threats?

reputedly, it is possible to make a "malicious" Word document. Maybe using embedded VB script? Anyway, not sure. My question is, is it possible to make an app that safely scrubs all such insertions from a .doc file? Of course, preferably this app should work without actually opening that file in Word application since presumably that may...

Word doc document.PrintOut won't print to a particular printer

I have the following .js file being run using cscript on Windows Vista with Office 2007: var err = 0; var app = WScript.CreateObject("Word.Application"); try { var filename = WScript.StdIn.ReadLine(); var enc = filename.toLowerCase().indexOf(".txt") >= 0 ? 65001 : 1252; var objDoc = app.Documents.Open(filename, false, true, false,...

How can I get full filenames from Git difftool (for Microsoft Word "Compare Documents" feature)?

I am using the latest version of Git (1.6.6) on a Mac. My wife wants to use Git to manage her fiction writing as long as she can still use Microsoft Word 2008 (Mac). Instead of pushing her into saving everything as plain text, I would like to use Git Difftool to pass the files to Word and use Word's Compare Documents feature. She wouldn'...

Non-empty fields are empty in word

I have created a multicolumn custom field and deployed it in SharePoint. To be able to use the field values from my custom field I also deployed an event receiver to copy the three values from my custom field to three separate regular text fields. If the three text fields do not exist I create them with XML in code. I also make sure the ...

Embedding word document in web form

I have a requirement to display word document in ASP.NET form. Also, the original word format has to be retained. In a nutshell i have to embed a word document in a web form programatically. Can someone please help. ...

Open/handle Word documents like SharePoint

Could anyone point me in the right direction when it comes to handling Word documents (.docx) on the server using asp.net. I know I can write to and read the .docx document using the API provided. But I would like to implement this like SharePoint does it. The user browses the web site, he is logged in, then chooses to make a new Word ...

Generate a blank table on form check in Word 2003

In Word 2003, I am trying to create a form that can generate additional entries if the person filling out the forms requires them and clicks a checkbox stating (for additional tables click here). I have tried a form field that runs a macro on entry but that does not seem to be working. Is there a more elegant way to make a form that can ...

XML Parser to read xml tags from word file C#

Hello there, I have some word templates(dot/dotx) files that contain xml tags along with plain text. At run time, I need to replace the xml tags with their respective mail merge fields. So, need to parse the document for these xml tags and replace them with merge fields. I was using Regex to find and replace these xml tags. But I was s...

Convert Word 6.0 to Word 2003 programatically

With the latest security update from MS Security Existing word templates documents could not be loaded and they started throwing exceptions each time we load. We would like to convert the existing Word 6.0 to Word 2003 programmatically or by using a tool. How do we convert using .NET? Or any existing MS Tool Thanks for the help ...

Print all characters for a font in MS Word

For some automated tests I need to create a Word Doc that contains all the characters of a font (for several different fonts). Is there an easy way to create a macro that loops through all the available characters in a font (and inserts them into a doc)? ...

Avoid WebDav requests on request for downloading .doc file

We have WebDAV activated on our server. And when we try to make a download of a word file from the server with the content-type "application/msword" a WebDAV authentication popup is shown. I do not want this popup. The file should just be downloaded and opened without The only way I can avoid this, is giving it content-type "applicatio...

Replace string in Word doc - Works in MainDocumentPart not in HeaderPart

Hi! I need to do a simple search and replace of a string in a word document. I thought it would be pretty easy, but it's not (at least for me) Check out this code (It takes a stream, opens the different part of the doc, searches for the string, and then it replaces it). Problem is that only whats inside the MainDocumentPart and the Fo...

automatically Match fields in word

How does Microsoft Word match fields in MailMerge automatically? For example: Word searches for the column that matches each element. In the illustration, Word automatically matched the data file's Surname column to Last Name. But Word was unable to match other elements. From this data file, for example, Word can't match...

How can I programatically (VBA) copy an excel slide to a Word document

Goal: Step 1. Use a PowerPoint presentation during a seminar that allows the presenter to click on text fields and fill in information while still in "slideshow" view. Step 2. Copy (in any way) the entered information to a word document. Currently one the slide in question I have a table in powerpoint with msotextboxes overlayed over ...

Question about replicating Word form fields in a table

I have a project in development that uses Word documents as an input mechanism to a larger system. My company's client has 4 different Word documents they use that contain form fields. When the document is submitted to our system, it will strip the data from the form fields and store it in a SQL Server database. I realize this isn't t...

What is the best way to get clean semantic XHTML from MS word documents?

Some days ago I received a rather lengthy and somewhat elaborate MS Word document, which I was asked to convert to HTML for uploading to a 3rd party’s website. My first instinct was to save the Word document as HTML and use Dreamweaver’s "Clean Up Word HTML" Command. But not only did I have to leave it running all night for Dreamweaver t...