Microsoft Word VBA Macro Programming - Introduction

Everything you need to know to confidentally start writing your own macros to automate Microsoft Word processes.
4.3 (44 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
5,407 students enrolled
$95
Take This Course
  • Lectures 73
  • Contents Video: 13 hours
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 7/2014 English

Course Description

The video tutorials in this course are designed to give you all the ammunition you'll need to start creating your own custom macros to automate Microsoft Word tasks and operations. Word users learn VBA macro programming for a number of reasons: some people are looking to enhance their career prospects; some are looking to save themselves time; others are aiming to save their company money and increase productivity.

Whatever your reasons for considering learning more about Word VBA macros, this course aims to equip you with everything you need to get started.

This course was last updated on November 2015 with the addition of a module aimed at providing further practice by guiding the user, step-by-step, through the creation of an interactive Word VBA solution.

What are the requirements?

  • The course is aimed at users of Microsoft Word 2013, 2010 or 2007, running on Windows XP, Windows 7 or Windows 8.

What am I going to get from this course?

  • By the end of the training, you will have the knowledge required to start confidently writing VBA macros which automate procedures in Word and which will enhance your own profile as a Word user and a Word developer.

What is the target audience?

  • This course is aimed at users with an intermediate or advanced knowledge of Microsoft Word but with little or no knowledge of VBA programming.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Getting Started
03:51

What you can expect from this course.

04:44

This lesson outlines the skills that you need to have in place before you can comfortably write your own macros from scratch.

08:00

In this tutorial we will download the course files, then install a gobal template inside which we will be saving all of the macros which we will create during the course.

06:34

The developer tab contains all of the options you'll need to start working with Word VBA...

13:55
In this video, we'll look at recording a macro and then editing the code generated by the recorder.
06:40

In this video, we'll look at adding a button to the Quick Access Toolbar which launches a macro when clicked.

04:10

In this video, we'll look at how you assign a keyboard shortcut to a macro.

10:26

In this video, we'll look at editing code generated by the macro recorder when you record a macro.

09:24

The macro recorder is a great way to check syntax that you are unsure of: you simply use the recorder, then look at the code that's been generated.

Section 2: Writing Macros in the Visual Basic Editor
17:54

Microsoft Word contains an application called the Visual Basic Editor (VBE) which is used for editing VBA code... Within the VBE, the first window that you need to get used to is the Project Explorer.

13:44

In this video, we'll have a look at some of the other windows in the Visual Basic Editor.

07:57

A macro is essentially a subroutine; so we'll be discussing the various types of subroutines that you can create inside a module.

11:31

In this video, we'll discuss some of the strategies you can use to find help on Word VBA topics.

Getting Help on VBA and the Word Object Model (Part 2)
15:19
13:13

In this two-part video, we'll look at how you can modify the way in which the Visual Basic Editor works by customizing the settings in the Tools > Options dialogue box.

08:01

In this two-part video, we'll look at how you can modify the way in which the Visual Basic Editor works by customizing the settings in the Tools > Options dialogue box.

06:01

The Project Properties settings allow to customize the way in which projects are displayed within the object browser.

Section 3: Variables and Constants
15:32

Variables are a facility found in all programming languages. They allow you to store information required by your programs and to refer back to that information, and modify it, at any time...

12:06

Although variable declaration is not compulsory in VBA, it is definitely recommended that you declare all variables that you intend to use...

10:01

Although variable declaration is not compulsory in VBA, it is definitely recommended that you declare all variables that you intend to use...

07:38

In this video, we'll look at declaring fixed length as well as variable length Strings; and we'll also look at a couple of VBA String functions.

14:28

In this video, we'll look at a couple of useful number functions; and we'll also look at how VBA handles the distinction between raw numbers and formatted numbers.

08:02

In this video, we'll look at how VBA enables you to work with Date variables. (We'll also have a quick look at Boolean variables.)

08:04

You'll very often need to keep track of values which will always be the same as your code executes; these are the kinds of values which you store in constants, rather then in variables.

08:36

In this video, we'll talk about using variables to store references to the Document, Range, Table and Row objects.

Section 4: Subroutines and Functions
11:00

In this video, we'll discuss a technique which allows you to have one main sub-procedures which calls a series of subordinate sub-routines.

06:06

In this video, we'll look at functions and how they differ from sub-routines. (The main difference is that functions can return a value.)

06:47

In this video, we'll look at how you can make your functions more flexible by defining arguments, or parameters.

08:47

VBA allows you to make arguments optional; which means that, when you call the function or sub-routine, you can either supply a value, or you can simply omit it.

09:52

When you divide your code into various sub-procedures, the question of variable scope becomes important...

Section 5: Conditionals, Loops and Arrays
09:09

We begin this section on conditional and looping statements with a look at the VBA If statement.

09:23

The Select ... Case statement provides and alternative to If and ElseIf when testing for several possibilities.

08:06

The For ... Next loop allows you to execute several lines of code repeatedly, a given number of times.

For...Next Statements (Part 2)
14:00
09:35

As well as using a counter to control looping, it is also possible to use a condition...

While…Wend Statements
15:36
11:29

Array variables allow you to store a related set of values, rather than a single value, like the variables we have seen so far...

Using Array Variables (Part 2)
09:29
12:44

Dynamic arrays are used in situations where you are not sure how many elements you need to cater for or where the number of elements can vary as your code executes.

Section 6: The Word Object Model
14:59

This video gives an overview of how the Word object model functions, its key aspects and key components.

15:23

In this video, we look a bit more closely at the syntax involved when working with object methods.

19:02

Properties are essentially the attributes of an object. However, to access these properties, you sometimes have to go via a child object...

14:15

In this video, we'll look at the syntax for homing in on individual objects.

11:52

In this video, we will look at why it is a bad idea to write code which selects and activates objects, rather than simply referencing them.

07:02

Before creating a reference to an object, you need to be sure that it actually exists. In this video, we look at how you test for the existence of an object within a collection.

09:07

In order to remove items from a collection, the logical thing to do is to loop through the collection and selectively delete certain items...

Section 7: Events, Dialogs and UserForms
14:24

In this first video, we will get an overview of how event programming works.

12:46

In this two-part video, we will see a practical example of how document events can be implemented within a Microsoft Word workflow.

Working with Document Events (Part 2)
12:58
18:01

Very often, you can simply avail yourself of Word's built-in dialogs, rather than having to reinvent the wheel and create your own user form.

14:38

In this video, we will take a closer look at creating a user form and adding various types of control to the user form.

Creating a UserForm (Part 2)
10:34
13:18

In this two-part video, we'll create a series of event procedures, to convert the form that we created in the last video, into an interactive form.

Creating UserForm Event-Handlers (Part 2)
11:33
10:18

When working with user forms you have to bear in mind that the user will not always enter data in the format, range or attributes that you want them to.

Section 8: Error Handling and Debugging
14:39

Before you share your macro solutions with colleagues or clients, it's always a good idea to think about shielding them from any unpleasant surprises...

06:42

In this video, we will revisit Tools > Options and discuss the settings relating to error handling.

08:15

In this video, we'll look at a statement which tells VBA to simply ignore any errors that occur and attempt to carry on as though nothing has happened...

11:51

The Err object is a resource that is built into VBA which provides information on errors, as they occur...

09:57

In this video, we'll turn our attention to debugging; tracking down errors when you can't get your code to work properly...

13:44

In this video, we'll talk about stepping through your code, in break mode.

09:11

The watch window provides a very convenient and dynamic method of exploring the values of expressions and variables while debugging code...

Section 9: Additional Step-by-Step Practice
Obtaining the course files
Preview
02:01
Overview of Project
Preview
03:09
Creating the Launch Macro
12:30
Creating the UserForm
07:06
Listing File Names in the Listbox Control
10:21
Updating the Preview Text Box
13:09
Programming the Remove Button
04:15
Programming the Move Up and Move Down Buttons
10:03
Programming the Cancel Button
05:49
Programming the Main Action Button Part 1
15:10
Programming the Main Action Button Part 2
11:43

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Grant Gamble, Developer, trainer and author

Grant Gamble is an experienced IT trainer, developer, consultant and author able to deliver a wide range of training courses. He has a vast experience of delivering public and on-site IT training content at different skill levels, to groups of varying sizes.

His UK company G Com Solutions Limited provide IT training courses and consultancy to a wide range of UK and international clients. His speciality is running week-long, intensive training workshops on topics like Microsoft VBA, web development and Adobe Creative Suite automation.

Ready to start learning?
Take This Course