Description

Book Synopsis
Many Microsoft Word users and VBA programmers don't realize the extensive opportunities that exist when Word's Object Model is accessed using Visual Basic for Applications (VBA), which replaced WordBasic in conjunction with the release of Word 97. By creating what is commonly called a "Word Macro" you can automate many features available in Word. Writing Word Macros (previously titled Learning Word Programming is the introduction to Word VBA that allows you to do these things and more, including: * Create custom pop-up menus * Automatically create tables from lists * Append one document to the end (or beginning) of another * Create a toggle switch to change a document from draft to final copy by adding or removing a watermark in the header * Generate reports using data from other applications Not intended to be an encyclopedia of Word programming, Writing Word Macros provides Word users, as well as programmers who are not familiar with the Word object model with a solid introduction to writing VBA macros and programs. In particular, the book focuses on: * The Visual Basic Editor and the Word VBA programming environment. Word features a complete and very powerful integrated development environment for writing, running, testing, and debugging VBA macros. * The VBA programming language (which is the same programming language used by Microsoft Excel, Access, and PowerPoint, as well as the retail editions of Visual Basic). * The Word object model. Word exposes nearly all of its functionality through its object model, which allows Word to be controlled programmatically using VBA. While the Word object model, with almost 200 objects, is the largest among the Office applications, readers need be familiar with only a handful of objects. Writing Word Macros focuses on these essential objects, but includes a discussion of a great many more objects as well.Writing Word Macros is written in a terse, no-nonsense manner that is characteristic of Steven Roman's straightforward, practical approach. Instead of a slow-paced tutorial with a lot of hand-holding, Roman offers the essential information about Word VBA that you must master to program effectively. This tutorial is reinforced by interesting and useful examples that solve practical programming problems, like generating tables of a particular format, managing shortcut keys, creating fax cover sheets, and reformatting documents. Writing Word Macros is the book you need to dive into the basics of Word VBA programming, enabling you to increase your power and productivity when using Microsoft Word.

Table of Contents
Preface 1. Introduction 2. Preliminaries What Is a Programming Language? Programming Style I. The VBA Environment 3. The Visual Basic Editor, Part I The Project Window The Properties Window The Code Window The Immediate Window Arranging Windows Document Events 4. The Visual Basic Editor, Part II Navigating the IDE Getting Help Creating a Procedure Run Mode, Design Mode, and Break Mode Errors Debugging Macros II. The VBA Programming Language 5. Variables, Data Types, and Constants Comments Line Continuation Constants Variables and Data Types VBA Operators 6. Functions and Subroutines Calling Functions Calling Subroutines Parameters and Arguments Exiting a Procedure Public and Private Procedures Referencing a Project 7. Built-in Functions and Statements The MsgBox Function The InputBox Function VBA String Functions Miscellaneous Functions and Statements 8. Control Statements The If - Then Statement The For Loop The For Each Loop The Do Loop The Select Case Statement A Final Note on VBA III. Objects and Object Models 9. Object Models Objects, Properties, and Methods Collection Objects Object Model Hierarchies Object Model Syntax Object Variables 10. The Word Object Model The Word Object Model: A Perspective Word Enums The VBA Object Browser 11. The Application Object Properties and Methods The Options Object The Task Object The Template Object The Window Object The Pane Object The View Object The Zoom Object 12. The Document Object Properties That Return Collections Spelling-Related Properties and Methods The Documents Collection Adding, Opening, and Saving Documents Password-Related Properties Protection-Related Properties and Methods The Name Properties Printing-Related Methods Additional Members of the Document Object Children of the Document Object Example: Printing Document Headings Example: Finding Used Styles 13. The Section and HeaderFooter Objects Adding a New Section The PageSetup Object Properties of the Section Object The HeaderFooter Object 14. The Range and Selection Objects Comparing the Range and Selection Objects Range and Selection Variables Creating a Range or Selection Object Changing a Range Object Range and Selection Object Properties and Methods 15. The Find and Replace Objects Searching for Text Searching for Formatting The Replace Operation The Execute Method Example: Repeated Searching 16. The Table Object Formatting-Related Properties and Methods The Cell Method The Columns and Rows Properties The ConvertToText Method Sorting Methods The Split Method Example: Creating Tables from Word Lists Example: Closing Up a Table 17. The List Object List Types The List Object The ListTemplate Object and ListGalleries Example: Looking at Lists 18. Shortcut Key Bindings Finding a Key Binding Creating a Key Binding The KeyBinding Object 19. Built-in Dialog Objects The Show Method The Display and Execute Methods The DefaultTab Property The Type Property The Update Method Example: Printing Document Statistics 20. Custom Dialog Boxes What Is a UserForm Object? Example: Adding a Closing to a Letter Example: A Fax Cover Sheet Example: Quick Selection 21. Menus and Toolbars An Overview CustomizationContext The CommandBars Collection The CommandBar Object Command Bar Controls IV. Appendixes A. Programming Word from Another Application B. The Shape Object C. Getting the Installed Printers D. High-Level and Low-Level Languages

Writing Word Macros

Product form

£29.99

Includes FREE delivery

RRP £39.99 – you save £10.00 (25%)

Order before 4pm today for delivery by Sat 20 Dec 2025.

A Paperback / softback by Steven Roman

Out of stock


    View other formats and editions of Writing Word Macros by Steven Roman

    Publisher: O'Reilly Media
    Publication Date: 23/11/1999
    ISBN13: 9781565927254, 978-1565927254
    ISBN10: 1565927257

    Description

    Book Synopsis
    Many Microsoft Word users and VBA programmers don't realize the extensive opportunities that exist when Word's Object Model is accessed using Visual Basic for Applications (VBA), which replaced WordBasic in conjunction with the release of Word 97. By creating what is commonly called a "Word Macro" you can automate many features available in Word. Writing Word Macros (previously titled Learning Word Programming is the introduction to Word VBA that allows you to do these things and more, including: * Create custom pop-up menus * Automatically create tables from lists * Append one document to the end (or beginning) of another * Create a toggle switch to change a document from draft to final copy by adding or removing a watermark in the header * Generate reports using data from other applications Not intended to be an encyclopedia of Word programming, Writing Word Macros provides Word users, as well as programmers who are not familiar with the Word object model with a solid introduction to writing VBA macros and programs. In particular, the book focuses on: * The Visual Basic Editor and the Word VBA programming environment. Word features a complete and very powerful integrated development environment for writing, running, testing, and debugging VBA macros. * The VBA programming language (which is the same programming language used by Microsoft Excel, Access, and PowerPoint, as well as the retail editions of Visual Basic). * The Word object model. Word exposes nearly all of its functionality through its object model, which allows Word to be controlled programmatically using VBA. While the Word object model, with almost 200 objects, is the largest among the Office applications, readers need be familiar with only a handful of objects. Writing Word Macros focuses on these essential objects, but includes a discussion of a great many more objects as well.Writing Word Macros is written in a terse, no-nonsense manner that is characteristic of Steven Roman's straightforward, practical approach. Instead of a slow-paced tutorial with a lot of hand-holding, Roman offers the essential information about Word VBA that you must master to program effectively. This tutorial is reinforced by interesting and useful examples that solve practical programming problems, like generating tables of a particular format, managing shortcut keys, creating fax cover sheets, and reformatting documents. Writing Word Macros is the book you need to dive into the basics of Word VBA programming, enabling you to increase your power and productivity when using Microsoft Word.

    Table of Contents
    Preface 1. Introduction 2. Preliminaries What Is a Programming Language? Programming Style I. The VBA Environment 3. The Visual Basic Editor, Part I The Project Window The Properties Window The Code Window The Immediate Window Arranging Windows Document Events 4. The Visual Basic Editor, Part II Navigating the IDE Getting Help Creating a Procedure Run Mode, Design Mode, and Break Mode Errors Debugging Macros II. The VBA Programming Language 5. Variables, Data Types, and Constants Comments Line Continuation Constants Variables and Data Types VBA Operators 6. Functions and Subroutines Calling Functions Calling Subroutines Parameters and Arguments Exiting a Procedure Public and Private Procedures Referencing a Project 7. Built-in Functions and Statements The MsgBox Function The InputBox Function VBA String Functions Miscellaneous Functions and Statements 8. Control Statements The If - Then Statement The For Loop The For Each Loop The Do Loop The Select Case Statement A Final Note on VBA III. Objects and Object Models 9. Object Models Objects, Properties, and Methods Collection Objects Object Model Hierarchies Object Model Syntax Object Variables 10. The Word Object Model The Word Object Model: A Perspective Word Enums The VBA Object Browser 11. The Application Object Properties and Methods The Options Object The Task Object The Template Object The Window Object The Pane Object The View Object The Zoom Object 12. The Document Object Properties That Return Collections Spelling-Related Properties and Methods The Documents Collection Adding, Opening, and Saving Documents Password-Related Properties Protection-Related Properties and Methods The Name Properties Printing-Related Methods Additional Members of the Document Object Children of the Document Object Example: Printing Document Headings Example: Finding Used Styles 13. The Section and HeaderFooter Objects Adding a New Section The PageSetup Object Properties of the Section Object The HeaderFooter Object 14. The Range and Selection Objects Comparing the Range and Selection Objects Range and Selection Variables Creating a Range or Selection Object Changing a Range Object Range and Selection Object Properties and Methods 15. The Find and Replace Objects Searching for Text Searching for Formatting The Replace Operation The Execute Method Example: Repeated Searching 16. The Table Object Formatting-Related Properties and Methods The Cell Method The Columns and Rows Properties The ConvertToText Method Sorting Methods The Split Method Example: Creating Tables from Word Lists Example: Closing Up a Table 17. The List Object List Types The List Object The ListTemplate Object and ListGalleries Example: Looking at Lists 18. Shortcut Key Bindings Finding a Key Binding Creating a Key Binding The KeyBinding Object 19. Built-in Dialog Objects The Show Method The Display and Execute Methods The DefaultTab Property The Type Property The Update Method Example: Printing Document Statistics 20. Custom Dialog Boxes What Is a UserForm Object? Example: Adding a Closing to a Letter Example: A Fax Cover Sheet Example: Quick Selection 21. Menus and Toolbars An Overview CustomizationContext The CommandBars Collection The CommandBar Object Command Bar Controls IV. Appendixes A. Programming Word from Another Application B. The Shape Object C. Getting the Installed Printers D. High-Level and Low-Level Languages

    Recently viewed products

    © 2025 Book Curl

      • American Express
      • Apple Pay
      • Diners Club
      • Discover
      • Google Pay
      • Maestro
      • Mastercard
      • PayPal
      • Shop Pay
      • Union Pay
      • Visa

      Login

      Forgot your password?

      Don't have an account yet?
      Create account