
- VBA RECORDSET LOOP THROUGH RECORDS WIZARD HOW TO
- VBA RECORDSET LOOP THROUGH RECORDS WIZARD PATCH
- VBA RECORDSET LOOP THROUGH RECORDS WIZARD FULL
- VBA RECORDSET LOOP THROUGH RECORDS WIZARD CODE
- VBA RECORDSET LOOP THROUGH RECORDS WIZARD DOWNLOAD
The name is irrelevant, but I try and group related things together in a module, so I recommend calling it "SendMail" or something similar.
VBA RECORDSET LOOP THROUGH RECORDS WIZARD CODE
After you cut and paste the code in, save the module. We do this by clicking on the module tab and adding a new module. Now, we need to add some code to our database to let it talk to Outlook and send our mail.

In the spot down below where it asks for the function name, type =SendEMail().Click on the macro tab and create a new macro.tho the macro won't work until we write the code. The nice thing is, we can make the macro first. In our case, we'll use it to trigger some code we're going to write. Macros provide easy ways to trigger code or run actions.
VBA RECORDSET LOOP THROUGH RECORDS WIZARD FULL
So, when you run the macro, it will ask you for the full path of the text file you just created with the body text in it.
VBA RECORDSET LOOP THROUGH RECORDS WIZARD HOW TO
There are other ways to do this (like storing the body in the database, for instance) but using an external file allows us to look at how to grab text from a file another handy skill to have. That way, you can just change the text file and not have to touch any of this code again. To keep things as generic as possible, I grab the body of the e-mail from a text file. We're only concerned with the field known as "email" Once you get the query the way you like it, save it as "MyEmailAddresses" The Body You can also add any other fields you want for purposes of filtering and whatnot. If the field that holds your email addresses is called anything other than "EMail" you can force it to be referred to as "Email" by putting "EMail:" in fromt of the field name in the query grid.

Select the field with the email addresses and call it "EMail". Open a new query and add the table that has the email addresses you want. so we need to use a query to get the e-mail addresses we want.

(If you didn't, you'd be reading something else, I'm sure!) You want to send all the people in the list an e-mail. You have a table that has a list of email addresses. I'm going to assume you have a basic understanding how Access works, and can make a query. You can then just import the query and module into your own database and skip the cutting and pasting.
VBA RECORDSET LOOP THROUGH RECORDS WIZARD DOWNLOAD
You can download the sample database in either Access97 (128k), Access2000 (132k) or Access2002 (164k) format. Here's a page with some links about the security model: (If anyone wants to convert it, lemme know, and I'll post your article.) Maybe someday I'll make a "Redemption" page, but I just don't have the time right now. This code doesn't work with Redemption - the theory does, but the actual code doesn't. if your IT policy doesn't allow for that, you're out of luck. However, it's $200 if you want to use it anywhere, and it does require installing a DLL on the client machine. It's more or less a rewrite of the Outlook model, but bypasses the security triggers.

You can get around the security model if you're willing to spend a little money. *sigh* Perhaps one of these days I will write an article explaining how to do this using a freeware mail component. Of course, YOU can't take advantage of this power any longer, since MS thinks you're unable to protect yourself. Since virus writers use these same techniques to send e-mail without you knowing, Microsoft instead pops up a dialog box for 3-5 seconds PER ADDRESS so the virus writer can't take advantage of you.
VBA RECORDSET LOOP THROUGH RECORDS WIZARD PATCH
NOTE: The Outlook Security Patch (it comes with Office 2000 SR-2, OfficeXP or as a seperate "security" download) makes this exercise just this side of useless. and we don't have to do anything in the middle beyond writing a query, a simple routine and a macro to make it all happen. and with that, we can use Access to store our e-mail addresses and use Outlook to send them. Finally, with Office97, all applications share a common macro language. (VBA) VBA is result of the merging of Visual Basic and the macro languages originally designed for the individual applications that now make up office. To this end, Microsoft has given all the pieces of the Office suite the ability to control or be controlled by other of its Office siblings through the use of Visual Basic for Applications. Microsoft Office is designed to work together in an effort to help users get their work done more efficiently.
