DOCUMENT:Q267984 06-DEC-2000 [foxpro] TITLE :HOWTO: Create and Use Custom Styles with Automation PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:2000,2000, Service Release 1 (SR-1),6.0,97 OPER/SYS: KEYWORDS:kbole kbAutomation kbvfp600 kbGrpDSFox kbDSupport kbWord97 kbword2000 ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 6.0, used with: - Microsoft Word 2000 Service Release 1 (SR-1) - Microsoft Word for Windows 95 ------------------------------------------------------------------------------- SUMMARY ======= Styles in Word make it easy to apply the same formatting to different parts of a document. A style contains information about the font, paragraph formatting, borders, shading, tabs, and more. There are a number of styles built into Word, but it's also possible to define custom styles. Every style is based on another style (the "base style") and inherits its characteristics from that style. To customize the new style, change its properties. Once you create a custom style, any changes to the base style are reflected in it. MORE INFORMATION ================ To create a new style: 1. Create an instance of the Word application server: oWord = CreateObject("Word.Application") 2. Create a new document: oDocument = oWord.Documents.Add() Alternatively, you can open an existing document using the Open method, passing the full path to the document: oDocument = oWord.Documents.Open() 3. Use the Add method of the Document's Styles collection, passing the name for the new style and a constant that indicates whether the new style is a paragraph style (wdStyleTypeParagraph = 1) or a character style (wdStyleTypeParagraph = 2): oStyle = oDocument.Styles.Add(