Fr. 66.00

Writing Word Macros - Learning to Program the Word Object Model Using VBA. Covers Word 97/2000

English · Paperback / Softback

Shipping usually within 3 to 5 weeks

Description

Read more

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.

List of contents










Dedication;
Preface;
A Title Change and Word 2000 Compliance;
The Book's Audience;
Organization of This Book;
The Book's Sample Code;
Conventions in This Book;
How to Contact Us;
Acknowledgments;
Chapter 1: Introduction;
Chapter 2: Preliminaries;
2.1 What Is a Programming Language?;
2.2 Programming Style;
The VBA Environment;
Chapter 3: The Visual Basic Editor, Part I;
3.1 The Project Window;
3.2 The Properties Window;
3.3 The Code Window;
3.4 The Immediate Window;
3.5 Arranging Windows;
3.6 Document Events;
Chapter 4: The Visual Basic Editor, Part II;
4.1 Navigating the IDE;
4.2 Getting Help;
4.3 Creating a Procedure;
4.4 Run Mode, Design Mode, and Break Mode;
4.5 Errors;
4.6 Debugging;
4.7 Macros;
The VBA Programming Language;
Chapter 5: Variables, Data Types, and Constants;
5.1 Comments;
5.2 Line Continuation;
5.3 Constants;
5.4 Variables and Data Types;
5.5 VBA Operators;
Chapter 6: Functions and Subroutines;
6.1 Calling Functions;
6.2 Calling Subroutines;
6.3 Parameters and Arguments;
6.4 Exiting a Procedure;
6.5 Public and Private Procedures;
6.6 Referencing a Project;
Chapter 7: Built-in Functions and Statements;
7.1 The MsgBox Function;
7.2 The InputBox Function;
7.3 VBA String Functions;
7.4 Miscellaneous Functions and Statements;
Chapter 8: Control Statements;
8.1 The If... Then Statement;
8.2 The For Loop;
8.3 The For Each Loop;
8.4 The Do Loop;
8.5 The Select Case Statement;
8.6 A Final Note on VBA;
Objects and Object Models;
Chapter 9: Object Models;
9.1 Objects, Properties, and Methods;
9.2 Collection Objects;
9.3 Object Model Hierarchies;
9.4 Object Model Syntax;
9.5 Object Variables;
Chapter 10: The Word Object Model;
10.1 The Word Object Model: A Perspective;
10.2 Word Enums;
10.3 The VBA Object Browser;
Chapter 11: The Application Object;
11.1 Properties and Methods;
11.2 The Options Object;
11.3 The Task Object;
11.4 The Template Object;
11.5 The Window Object;
11.6 The Pane Object;
11.7 The View Object;
11.8 The Zoom Object;
Chapter 12: The Document Object;
12.1 Properties That Return Collections;
12.2 Spelling-Related Properties and Methods;
12.3 The Documents Collection;
12.4 Adding, Opening, and Saving Documents;
12.5 Password-Related Properties;
12.6 Protection-Related Properties and Methods;
12.7 The Name Properties;
12.8 Printing-Related Methods;
12.9 Additional Members of the Document Object;
12.10 Children of the Document Object;
12.11 Example: Printing Document Headings;
12.12 Example: Finding Used Styles;
Chapter 13: The Section and HeaderFooter Objects;
13.1 Adding a New Section;
13.2 The PageSetup Object;
13.3 Properties of the Section Object;
13.4 The HeaderFooter Object;
Chapter 14: The Range and Selection Objects;
14.1 Comparing the Range and Selection Objects;
14.2 Range and Selection Variables;
14.3 Creating a Range or Selection Object;
14.4 Changing a Range Object;
14.5 Range and Selection Object Properties and Methods;
Chapter 15: The Find and Replace Objects;
15.1 Searching for Text;
15.2 Searching for Formatting;
15.3 The Replace Operation;
15.4 The Execute Method;
15.5 Example: Repeated Searching;
Chapter 16: The Table Object;
16.1 Formatting-Related Properties and Methods;
16.2 The Cell Method;
16.3 The Columns and Rows Properties;
16.4 The ConvertToText Method;
16.5 Sorting Methods;
16.6 The Split Method;
16.7 Example: Creating Tables from Word Lists;
16.8 Example: Closing Up a Table;
Chapter 17: The List Object;
17.1 List Types;
17.2 The List Object;
17.3 The ListTemplate Object and ListGalleries;
17.4 Example: Looking at Lists;
Chapter 18: Shortcut Key Bindings;
18.1 Finding a Key Binding;
18.2 Creating a Key Binding;
18.3 The KeyBinding Object;
Chapter 19: Built-in Dialog Objects;
19.1 The Show Method;
19.2 The Display and Execute Methods;
19.3 The DefaultTab Property;
19.4 The Type Property;
19.5 The Update Method;
19.6 Example: Printing Document Statistics;
Chapter 20: Custom Dialog Boxes;
20.1 What Is a UserForm Object?;
20.2 Example: Adding a Closing to a Letter;
20.3 Example: A Fax Cover Sheet;
20.4 Example: Quick Selection;
Chapter 21: Menus and Toolbars;
21.1 An Overview;
21.2 CustomizationContext;
21.3 The CommandBars Collection;
21.4 The CommandBar Object;
21.5 Command Bar Controls;
Appendixes;
Programming Word from Another Application;
Setting a Reference to the Word Object Model;
Getting a Reference to the Word Application Object;
An Alternative Approach;
The Shape Object;
The Shape and InLineShape Objects;
Z-Order;
Creating InLineShapes;
Creating Shapes;
Examples;
WordArt;
Getting the Installed Printers;
High-Level and Low-Level Languages;
BASIC;
Visual Basic;
C and C++;
Visual C++;
Pascal;
FORTRAN;
COBOL;
Lisp;
Colophon;

About the author

Steven Roman, Ph.D., is a professor emeritus of mathematics at the California State University, Fullerton. His previous books with O'Reilly include Access Database Design and Programming, Writing Excel Macros, and Win32 API Programming with Visual Basic.

Summary

Delving into VBA programming, this text explains how to use VBA to automate many tedious, repetitive jobs using Microsoft Word. Included is information on how to: create custom pop-up menus; automatically create tables from lists; and generate reports using data from other applications.

Customer reviews

No reviews have been written for this item yet. Write the first review and be helpful to other users when they decide on a purchase.

Write a review

Thumbs up or thumbs down? Write your own review.

For messages to CeDe.ch please use the contact form.

The input fields marked * are obligatory

By submitting this form you agree to our data privacy statement.