Here's What
You'll Learn
We'll start out by building the sample
database we'll use in class. This will be a simple customer table,
with a related (one-to-many) table to store an unlimited number
of attachments per customer. We'll create a centralized Attachments
folder and we'll copy some sample files there. You'll learn how to
display an external image on a form.

Next you will learn how to
double-click on those attachment filenames and have them open up in
the program you specify using an event with a little bit of
VBA
code and the SHELL function. You will learn how to determine what program to use to open the
file (TXT files in Notepad, DOCX files in Word, etc.)

It's nice to be able to specifically
control which program you want to open a specific type of file, but
sometimes you want Access to just use the default program that's
installed in Windows. This is called the "default handler" for that file
type. You may not know if they have Adobe Acrobat installed for PDF
files, so in that case Windows might open them in Word. In the next
lesson we'll learn about the ShellExecute function which can deal
with this scenario.

Next we'll build a button that we can
click on to open the customer's address up directly in Google
Maps. This will involve creating a custom URL and launching
the default browser. You'll also see how you can open Windows Explorer
to browse folders, and how to use a mailto link to send email.

Finally we'll learn some advanced
features about the ShellExec subroutine we build in class. We'll
see how to set up error handling for when a file cannot be opened, learn
about public and private constants, and learn about different arguments
for ShellExec like "OPEN" and "PRINT".
If you want to be able to work with
external files and programs with Access, this is the perfect seminar
for you. You will learn everything mentioned above. You will have
access to the full database that we build in class with all of these
features. If you have any question whether this seminar is right for
you, please feel free to
contact me.

Opening Other Programs Outline
00. Intro (7:18)
01. Display External Images (17:29)
Create Customer Table Setup File Attachments Folder Copy Images to Folder
Create Customer Form Display Customer Image on Form Multiple Attachments
Per Customer Setup Attachments Table Display File Extensions Hide
Extensions for Known File Types Attachments Subform
02. Shell
Command (23:33) Command Button Build Event SHELL Function
vbNormalFocus System Path Variable Command Prompt Determining What
Program Opens a File On Double Click Event Dealing with Spaces in File
Names Launching Internet Explorer Command Line Arguments Switches
03. ShellExec Command (20:57) ShellExecute Function Create the
ShellExec Sub Code Sample Table and Form Choose Default File Handler
Open Web Page with ShellExec Open Google Maps to Customer Address Build
Google Maps URL Replace Function Open Folder with Windows Explorer
Sending Email with Mailto
04. ShellExec Command Advanced (7:24)
Private and Public Constants Error Handling Other OPEN type arguments
05. Review (2:35)

|