0%

Book Description

Customize and ramp-up Office 365 applications

NOTE: Please click the Downloads link (on the left of the page) to download “Full Code Download.”

The revised 2019 edition of Mastering VBA Microsoft Office 365 offers an accessible guide that shows how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. To enhance understanding, the content is explored in real-world projects in Word, Excel, Outlook, and PowerPoint.

Since the technical programming methods in the Office applications continue to evolve, the updated 2019 edition reviews the changes to the program. Code libraries, the API, and the object model for each Office program have been modified during the three years since the last version of this book. Various elements within VBA have been deprecated or replaced, and the surface UI changed as well. The updated 2019 edition covers topics such as:

•    Recording macros and getting started with VBA

•    Learning how to work with VBA

•    Using loops and functions

•    Using message boxes, input boxes, and dialog boxes

•    Creating effective code

•    XML-based files, ActiveX, the developer tab, content controls, add-ins, embedded macros, and security

Written for all levels of Microsoft Office 365 users, Mastering VBA Microsoft Office 365: 2019 Edition explains how to customize and automate the Office suite of applications. 

Table of Contents

  1. Cover
  2. Acknowledgments
  3. About the Author
  4. Introduction
    1. Where to Get This Book's Example Code
    2. If You Have Questions
    3. What Can I Do with VBA?
    4. What's in This Book?
    5. How Should I Use This Book?
    6. Is This Book Suitable for Me?
    7. Conventions Used in This Book
    8. For More Information
  5. Part 1: Recording Macros and Getting Started with VBA
    1. Chapter 1: Recording and Running Macros in the Office Applications
      1. What Is VBA and What Can You Do with It?
      2. Understanding Macro Basics
      3. Recording a Macro
      4. Running a Macro
      5. Recording a Sample Word Macro
      6. Recording a Sample Excel Macro
      7. Specifying How to Trigger an Existing Macro
      8. Deleting a Macro
      9. The Bottom Line
    2. Chapter 2: Getting Started with the Visual Basic Editor
      1. Opening the Visual Basic Editor
      2. Using the Visual Basic Editor's Main Windows
      3. Setting Properties for a Project
      4. Customizing the Visual Basic Editor
      5. The Bottom Line
    3. Chapter 3: Editing Recorded Macros
      1. Testing a Macro in the Visual Basic Editor
      2. Editing a Word Macro
      3. Editing an Excel Macro
      4. Editing a PowerPoint Macro
      5. The Bottom Line
    4. Chapter 4: Creating Code from Scratch in the Visual Basic Editor
      1. Setting Up the Visual Basic Editor to Create Macros
      2. Creating a Procedure for Word
      3. Creating a Macro for Excel
      4. Creating a Procedure for PowerPoint
      5. Creating a Procedure for Access
      6. The Bottom Line
  6. Part 2: Learning How to Work with VBA
    1. Chapter 5: Understanding the Essentials of VBA Syntax
      1. Getting Ready
      2. Procedures
      3. Statements
      4. Keywords
      5. Expressions
      6. Operators
      7. Variables
      8. Constants
      9. Arguments
      10. Objects
      11. Collections
      12. Properties
      13. Methods
      14. Events
      15. The Bottom Line
    2. Chapter 6: Working with Variables, Constants, and Enumerations
      1. Working with Variables
      2. Working with Constants
      3. Working with Enumerations
      4. The Bottom Line
    3. Chapter 7: Using Array Variables
      1. What Is an Array?
      2. Sorting an Array
      3. Searching an Array
      4. The Bottom Line
    4. Chapter 8: Finding the Objects, Methods, and Properties You Need
      1. What Is an Object?
      2. Working with Collections
      3. Finding the Objects You Need
      4. Using Object Variables to Represent Objects
      5. Team Programming and OOP
      6. The Bottom Line
  7. Part 3: Making Decisions and Using Loops and Functions
    1. Chapter 9: Using Built-In Functions
      1. What Is a Function?
      2. Using Functions
      3. Using the Format Function to Format an Expression
      4. Using VBA's Mathematical Functions
      5. Using VBA's Date and Time Functions
      6. Using File-Management Functions
      7. The Bottom Line
    2. Chapter 10: Creating Your Own Functions
      1. Components of a Function
      2. Creating a Function
      3. Examples of Functions for All VBA-Enabled Office Applications
      4. Creating a Function for Word
      5. Creating a Function for Excel
      6. Creating a Function for PowerPoint
      7. Creating a Function for Access
      8. The Bottom Line
    3. Chapter 11: Making Decisions in Your Code
      1. How Do You Compare Things in VBA?
      2. Testing Multiple Conditions by Using Logical Operators
      3. Select Case Blocks
      4. The Bottom Line
    4. Chapter 12: Using Loops to Repeat Actions
      1. When Should You Use a Loop?
      2. Understanding the Basics of Loops
      3. Using For…Loops for Fixed Repetitions…Loops for Fixed Repetitions
      4. Using Do…Loops for Variable Numbers of Repetitions…Loops for Variable Numbers of Repetitions
      5. While…Wend Loops
      6. Nesting Loops
      7. Avoiding Infinite Loops
      8. The Bottom Line
  8. Part 4: Using Message Boxes, Input Boxes, and Dialog Boxes
    1. Chapter 13: Getting User Input with Message Boxes and Input Boxes
      1. Opening a Macro
      2. Displaying Status-Bar Messages in Word and Excel
      3. Message Boxes
      4. Input Boxes
      5. Forms: When Message Boxes and Input Boxes Won't Suffice
      6. The Bottom Line
    2. Chapter 14: Creating Simple Custom Dialog Boxes
      1. When Should You Use a Custom Dialog Box?
      2. Creating a Custom Dialog Box
      3. Working with Groups of Controls
      4. Linking a Form to a Procedure
      5. Retrieving the User's Choices from a Dialog Box
      6. Examples Showing How to Connect Forms to Procedures
      7. Using an Application's Built-In Dialog Boxes
      8. The Bottom Line
    3. Chapter 15: Creating Complex Forms
      1. Creating and Working with Complex Dialog Boxes
      2. Using Events to Control Forms
      3. The Bottom Line
  9. Part 5: Creating Effective Code
    1. Chapter 16: Building Modular Code and Using Classes
      1. Creating Modular Code
      2. Creating and Using Classes
      3. The Bottom Line
    2. Chapter 17: Debugging Your Code and Handling Errors
      1. Principles of Debugging
      2. The Different Types of Errors
      3. VBA's Debugging Tools
      4. Dealing with Infinite Loops
      5. Dealing with Runtime Errors
      6. Suppressing Alerts
      7. Handling User Interrupts in Word, and Excel
      8. Documenting Your Code
      9. The Bottom Line
    3. Chapter 18: Building Well-Behaved Code
      1. What Is a Well-Behaved Macro?
      2. Retaining or Restoring the User Environment
      3. Leaving the User in the Best Position to Continue Working
      4. Keeping the User Informed During the Procedure
      5. Making Sure a Macro Is Running Under Suitable Conditions
      6. Cleaning Up After a Procedure
      7. The Bottom Line
    4. Chapter 19: Exploring VBA's Security Features
      1. Understanding How VBA Implements Security
      2. Signing Your Macro Projects with Digital Signatures
      3. Choosing a Suitable Level of Security
      4. Locking Your Code
      5. The Bottom Line
  10. Part 6: Programming the Office Applications
    1. Chapter 20: Understanding the Word Object Model and Key Objects
      1. Examining the Word Object Model
      2. Working with the Documents Collection and the Document Object
      3. Saving a Document
      4. Opening a Document
      5. Closing a Document
      6. Changing a Document's Template
      7. Printing a Document
      8. Working with the ActiveDocument Object
      9. Working with the Selection Object
      10. Creating and Using Ranges
      11. Manipulating Options
      12. The Bottom Line
    2. Chapter 21: Working with Widely Used Objects in Word
      1. Using Find and Replace via VBA
      2. Working with Headers, Footers, and Page Numbers
      3. Working with Sections, Page Setup, Windows, and Views
      4. Working with Tables
      5. The Bottom Line
    3. Chapter 22: Understanding the Excel Object Model and Key Objects
      1. Getting an Overview of the Excel Object Model
      2. Understanding Excel's Creatable Objects
      3. Managing Workbooks
      4. Working with Worksheets
      5. Working with the Active Cell or Selection
      6. Working with Ranges
      7. Setting Options
      8. The Bottom Line
    4. Chapter 23: Working with Widely Used Objects in Excel
      1. Working with Charts
      2. Working with Windows Objects
      3. Working with Find and Replace
      4. Adding Shapes
      5. The Bottom Line
    5. Chapter 24: Understanding the PowerPoint Object Model and Key Objects
      1. Getting an Overview of the PowerPoint Object Model
      2. Understanding PowerPoint's Creatable Objects
      3. Working with Presentations
      4. Working with Windows and Views
      5. Working with Slides
      6. Working with Masters
      7. The Bottom Line
    6. Chapter 25: Working with Shapes and Running Slide Shows
      1. Working with Shapes
      2. Working with Headers and Footers
      3. Setting Up and Running a Slide Show
      4. The Bottom Line
    7. Chapter 26: Understanding the Outlook Object Model and Key Objects
      1. Getting an Overview of the Outlook Object Model
      2. Working with the Application Object
      3. Understanding General Methods for Working with Outlook Objects
      4. Working with Messages
      5. Working with Calendar Items
      6. Working with Tasks and Task Requests
      7. Searching for Items
      8. The Bottom Line
    8. Chapter 27: Working with Events in Outlook
      1. How Event-Handler Procedures Differ from Ordinary Macros
      2. Working with Application-Level Events
      3. Working with Item-Level Events
      4. Understanding Quick Steps
      5. The Bottom Line
    9. Chapter 28: Understanding the Access Object Model and Key Objects
      1. Getting Started with VBA in Access
      2. Getting an Overview of the Access Object Model
      3. Understanding Creatable Objects in Access
      4. Opening and Closing Databases
      5. Working with the Screen Object
      6. Using the DoCmd Object to Run Access Commands
      7. The Bottom Line
    10. Chapter 29: Accessing One Application from Another Application
      1. Understanding the Tools Used to Communicate Between Applications
      2. Using Automation to Transfer Information
      3. Using the Shell Function to Run an Application
      4. Using Data Objects to Store and Retrieve Information
      5. Communicating via DDE
      6. Communicating via SendKeys
      7. Going Beyond VBA
      8. The Bottom Line
  11. Appendix The Bottom Line
    1. Chapter 1: Recording and Running Macros in the Office Applications
    2. Chapter 2: Getting Started with the Visual Basic Editor
    3. Chapter 3: Editing Recorded Macros
    4. Chapter 4: Creating Code from Scratch in the Visual Basic Editor
    5. Chapter 5: Understanding the Essentials of VBA Syntax
    6. Chapter 6: Working with Variables, Constants, and Enumerations
    7. Chapter 7: Using Array Variables
    8. Chapter 8: Finding the Objects, Methods, and Properties You Need
    9. Chapter 9: Using Built‐in Functions
    10. Chapter 10: Creating Your Own Functions
    11. Chapter 11: Making Decisions in Your Code
    12. Chapter 12: Using Loops to Repeat Actions
    13. Chapter 13: Getting User Input with Message Boxes and Input Boxes
    14. Chapter 14: Creating Simple Custom Dialog Boxes
    15. Chapter 15: Creating Complex Forms
    16. Chapter 16: Building Modular Code and Using Classes
    17. Chapter 17: Debugging Your Code and Handling Errors
    18. Chapter 18: Building Well‐Behaved Code
    19. Chapter 19: Exploring VBA's Security Features
    20. Chapter 20: Understanding the Word Object Model and Key Objects
    21. Chapter 21: Working with Widely Used Objects in Word
    22. Chapter 22: Understanding the Excel Object Model and Key Objects
    23. Chapter 23: Working with Widely Used Objects in Excel
    24. Chapter 24: Understanding the PowerPoint Object Model and Key Objects
    25. Chapter 25: Working with Shapes and Running Slide Shows
    26. Chapter 26: Understanding the Outlook Object Model and Key Objects
    27. Chapter 27: Working with Events in Outlook
    28. Chapter 28: Understanding the Access Object Model and Key Objects
    29. Chapter 29: Accessing One Application from Another Application
  12. Index
  13. End User License Agreement
18.218.172.249