• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Word 2003 XML Hacks > 91. Create a Word Document in Notepad

Create a Word Document in Notepad

This hack demonstrates how you can use simple XML files to create Word documents.

If you save one of your Word documents—even a very simple one with just a line or two of text—in XML format, then open it in a standard text editor such as Notepad, you’ll see that the file contains much more than just the text you typed.

Fortunately, Word can fill in most of that information if it’s missing, so you don’t need to be quite so verbose when creating XML documents meant to be opened in Word.

For example, open Notepad or another standard text editor and type the following:

<?xml version="1.0"?>
<?mso-application progid="Word.Document"?>
<w:wordDocument
  xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml">
  <w:body>
    <w:p>
      <w:r>
        <w:t>Hello, World!</w:t>
      </w:r>
    </w:p>
  </w:body>
</w:wordDocument>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint