Category Archives: Word

Convert RTF and TXT files into DOCX files in C#

First add a reference to Microsoft.Office.Interop.Word. To make using the library easier, add this using statement: using Word = Microsoft.Office.Interop.Word; When you enter the input and output file names and click Convert, the program uses the following code to open … Continue reading

Posted in files, interoperability, Office, Word | Tagged , , , , , , , , , , , , , | Leave a comment

Convert doc files into docx files in C#

This example shows how to write a C# program to automatically convert doc files into docx files. In a previous version of Windows, whenever I double-clicked a .doc file, I got this error message: Error The operating system is not … Continue reading

Posted in Office, Word | Tagged , , , , , , , , , , , , | Leave a comment

List the unique words in a Microsoft Word file in C#

The example List unique words in a text file in C# shows how to list the unique the words in a text file. This example shows how to list the unique words in a Microsoft Word file. Before you start, … Continue reading

Posted in files, Office, strings, Word | Tagged , , , , , , , , , , , , | Leave a comment

Remove the hyperlinks from a Word document in C#

This example shows how you can remove the hyperlinks from a Word document. When you select text on a web page and paste it into a Word document, the result often contains hyperlinks that you don’t want. (Actually after you … Continue reading

Posted in files, Office, Word | Tagged , , , , , , , , , , , | Leave a comment

Add a picture to a Word document in C#

This example shows how a C# program can add a picture to a Word document. It also shows how to use a bookmark to find the beginning of the Word document, make text flow around the picture, and align the … Continue reading

Posted in interoperability, Office, Word | Tagged , , , , , , , , , , , , , , , | 2 Comments

Create a Word document in C#

This example shows how to make a C# program create a Word document. First open the Add References dialog. On the COM tab, select “Microsoft Word 14.0 Object Library” (or whatever version you have installed on your system). Add the … Continue reading

Posted in interoperability, Office, Word | Tagged , , , , , , , , , , , , | 1 Comment

Use Microsoft Word to make a timezone conversion chart in C#

This example uses Word to generate a timezone conversion chart that lets you easily convert hours from one timezone to another. Select a date and the two timezones. Then press Make Chart to make the conversion chart. (You need to … Continue reading

Posted in internationalization, Office, Word | Tagged , , , , , , , , , , , | 1 Comment

A plea for help: Tell me what you want to see in my blog!

I get remarkably little feedback from my blog. I track post views and know that I have 857 Twitter followers, but people rarely let me know if they particularly like or dislike a post. That makes it hard for me … Continue reading

Posted in ADO.NET, algorithms, animation, API, challenges, combinatorics, controls, cryptography, curve fitting, database, extension methods, files, fonts, fractals, games, geometry, globalization, graphics, internationalization, LINQ, localization, mathematics, Office, phone, printing, reflection, registry, serialization, threading, transformations, user interface, Word, wpf, XAML, XML | 13 Comments

Use VBA macros to add and remove hyperlinks to external PowerPoint and Word files in C#

My book Essential Algorithms: A Practical Approach to Computer Algorithms has associated instructor materials that include lesson plans and PowerPoint presentations. There’s also a summary Excel workbook. In the workbook, column C contains links to lesson plans (Word documents) and … Continue reading

Posted in Excel, Office, PowerPoint, Word | Leave a comment

Create a PowerPoint presentation that makes slides corresponding to selected styles in a Microsoft Word document in C#

Sorry I haven’t had much time to post lately (and probably won’t for a little while longer). But this post is fairly big so hopefully it’ll give you something to think about for a while. Enter or select a Word … Continue reading

Posted in interoperability, Office, Word | Leave a comment