Programming in VBA - Using Microsoft Word 2016 BeginnersLoanNew
The skills and knowledge acquired in this course are sufficient to be able to create real life working VBA applications within Word. The learner will be able to work with VBA within the Word environment to program and automate document operations.
Anyone who wants to learn the basics about VBA within the Word environment
The course assumes a good working knowledge of the software. The learner should be able to create and edit different kinds of documents and must also have a general understanding of personal computers and the Windows operating system environment and be able to use File Explorer to locate and copy files.
Understanding Word VBA
- Programming In Microsoft Word
- VBA Terminology
- Displaying The Developer Tab
- The VBA Editor Screen
- Opening And Closing The Editor
- Understanding Objects
- The Object Hierarchy
- Viewing The Word Object Model
- Using The Immediate Window
- Working With Object Collections
- Setting Property Values
- Using The Object Browser
- Programming With The Object Browser
- Accessing Help
Starting With Word VBA
- Using The Project Explorer
- Using The Properties Window
- Using The Work Area
- Viewing Other Panes
- Working With Toolbars
- Working With A Code Module
- Running Code From The Editor
- Setting Breakpoints In Code
- Stepping Through Code
Procedures
- Understanding Procedures
- Where To Write Procedures
- Creating A New Sub Routine
- Using IntelliSense
- Using The Edit Toolbar
- Commenting Statements
- Indenting Code
- Bookmarking In Procedures
Variables
- Understanding Variables
- Creating And Using Variables
- Explicit Declarations
- The Scope Of Variables
- Procedure Level Scoping
- Module Level Scoping
- Understanding Passing Variables
- Passing Variables By Reference
- Passing Variables By Value
- Understanding Data Types For Variables
- Declaring Data Types
- Using Arrays
Functions
- Understanding Functions
- Creating And Calling Functions
- The MsgBox Function
- Using MsgBox
- The InputBox Function
- Using The InputBox Function
- Nesting Functions
- Using Functions In Function Procedures
Decision Structures
- The If Statement
- Using If For Single Conditions
- Using If For Multiple Conditions
- The Select Case Statement
- Using The Select Case Statement
- Using Select For Sets Of Values
- Using Select For Ranges Of Values
Looping Structures
- For Loops
- Looping With Specified Iterations
- Looping For Each Item
- Adding An Exit To A Loop
- The Do…Loop Statement
- Looping With Unknown Iterations
Working With Text
- Understanding Text And Document Components
- Understanding The Story Range
- Understanding The Selection Object
- Using The Selection Object
- Understanding The Range Object
- Using Range Objects
- Assignment: Inserting Text
- Code: Inserting Text
- Assignment: Displaying Text In A Text Box
- Code: Displaying Text In A Text Box
- Understanding The Find Object
- Assignment: Performing A Find Operation
- Code: Performing A Find Operation
Document Management
- The Activate, Open And Close Methods
- Opening And Closing Documents
- Understanding The Add Method
- Understanding The Save And Save As Methods
- Assignment: Creating And Saving Documents
- Code: Creating And Saving Documents
- Properties That Return Information
- Functions That Return Information
- Assignment: Getting Information
- Code: Getting Information
- Understanding Files, Folders And Drives
- Working With Files And Folders
- Assignment: Displaying Files In A UserForm
- Code: Displaying Code In A UserForm
- Removing Files And Folders
- The Application And Options Object
Creating Custom Forms
- Understanding VBA Forms
- Creating A Custom Form
- Adding Text Boxes To A Form
- Adding Label Controls To A Form
- Changing Text Box Control Properties
- Adding A Combo Box Control
- Adding Option Buttons
- Adding Command Buttons
- Changing The Appearance Of Controls
- Running A Custom Form
Programming UserForms
- Handling Form Events
- Initialising A Form
- Closing A Form
- Creating Functions For A Form
- Creating Code For Option Buttons
- Assignment: Using The AfterUpdate Event
- Code: Using The AfterUpdate Event
- Setting Bookmarks For Data Entry
- Assignment: Using Bookmarks To Enter Data
- Code: Using Bookmarks To Enter Data
- Setting The Tab Order
- Forcing Correct Entry
- Templates And AutoStart Macros
- Creating A Template With Auto Macros
Error Handling
- Understanding Error Types
- The On Error Statement
- Simple Error Trapping
- Using The Resume Statement
- Using Decision Structures In Error Handlers
- Assignment: Using The Err Object
- Code: Using The Err Object
- Assignment: Error Handling In Event Procedures
- Code: Error Handling In Event Procedures
- Defining Custom Errors
Built-In Dialogs
- The Dialogs Collection
- Dialog Box Arguments
- Using The Execute Method
- Using The Show Method
- The Display Method
- Using The Display Method
- Working With Dialog Tabs
- Assignment: Using Dialogs With A UserForm
- Code: Using Dialogs With A UserForm
At the completion of this course you should be able to:
- understand the Word object model and VBA concepts
- work effectively with the main features of the VBA Editor window
- create procedures in VBA
- create and use variables
- create and work with user-defined functions
- use programming techniques to control the action taken by your program
- construct loops that repeat code according to different requirements
- identify and select specific text using code modules
- create and use code to undertake basic file management tasks
- create code to drive a user form
- write a variety of error handling routines
- use VBA code to display and use Word's built-in dialog boxes
Watsonia workbook with 113 topics. Files for the exercises are provided on a CD or can be downloaded here
Approximately 10 hours
Booking / availability