Although these samples are very old, they may work with newer versions of Outlook. Some will need a little tweaking. In some cases, there are better ways to do "it" now, however, you can learn from looking at the old code samples.
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
17 | VBS | Import Access data into Outlook contact
items Updated 9/26/2000 |
Imports data from a table in an Access database, and uses the data to create Contact items in an Outlook folder. Shows the syntax for both standard and custom Outlook fields. Works with both Outlook 98/Access 97 and Outlook 2000/Access 2000. | code17.zip 123 KB |
21 | VBS | Filling an Outlook Combo Box or List
Box from an Access table Updated 9/26/2000 |
Fills a combo box or list box on an Outlook form from code, pulling data from the Categories and Customers tables in the sample Northwind database provided with Access. Works with both Access 97 and Access 2000. | code21.zip 51 KB |
49 | VBA | Exporting
Contact Data from Access to Outlook Updated 8/26/2000 |
Exports contact data stored in an Access table to new Outlook contacts, using a DAO recordset to pick up the data from the Access table, and the Add method of the Contacts folder's Items collection to create new Outlook contacts. Also includes buttons to create different types of Outlook items, and to list the Outlook folders. | code49.zip 211 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
2 | VBA | Writing an
Access Contact to a Word Letter Updated 7-Aug-2007 |
Using OLE Automation and Word custom document properties to create a single Word letter based on a template, with data from the current address on an Access form. | code2.zip 295 KB |
3 | VBA | Merging
Access Data to Word Mailing Labels Updated 8/9/2000 |
This code sample prints contact addresses from an Access table to a Word document formatted for Avery #5160 address labels, using a DAO recordset that iterates through the records in the table, and puts one address in each cell of a Word table in the document. | code3.zip 138 KB |
9 | VBA | Importing
Access Data into a Word Table Updated 9/26/2000 |
Imports data from a query in the sample Northwind database into a Word table, and sorts and formats the data to create a grouped report. | code9.zip 134 KB |
24 | VBA | Merging to Word Four
Ways
6/9/2002 |
Demonstrates four ways to merge Access data to Word documents – Word document properties, bookmarks, the TypeText method and DDE mail merge. Both Access 97 and Access 2000 databases are provided the Access 2000 database also works in Access 2002. | code24.zip 508 KB |
25 | VBA | Filling a listbox on a Word UserForm
with data from Access 7/24/1999 |
Fills a listbox on a UserForm opened from a Word document with data from the Products table in the sample Northwind database. This code is for Office 2000. | code25.zip 16 KB |
35 | VBA | Selecting
Access Contacts for a Word Merge Letter from a Multi-Select Listbox Updated 13-Apr-2005 |
Fills a listbox on a UserForm opened from a Word document with contact data from an Access table, and generates Word letters to the selected contacts. Works with both Office 97 and Office 2000. | 223 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
19 | VBS | Open an Excel worksheet 3/10/1998 |
This sample includes an Outlook form and an Excel worksheet, demonstrating how to open a worksheet from a command button on the Outlook form. | code19.zip 11 KB |
61 | VBA | Create
Distribution List from an Excel Worksheet 12-Aug-2007 |
This sample includes an Excel worksheet with a list of names and email addresses, and a saved VBA module containing a procedure that creates an Outlook Distribution List from data in the worksheet. Works in Office 2003, and probably in 2000, 2002 and 2007 as well. |
code61.zip 294 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
5 | VBS | Change
contact items to another form using Item.Add 3/10/1998 |
This sample includes an Outlook form with a procedure running from a command button which takes data from Contact items in a folder and produces new contact items from a form of your choice. The new items are placed in another folder. You should use the method in Code Sample #28 first; use this only in the rare cases where that method doesn't work. | code5.zip 22 KB |
14 | VBS | Work with
the Restrict clause 3/10/1998 |
This sample includes two Outlook forms demonstrating the use of the Restrict clause to select items from another folder and display them in a list box on a page of the form. | code14.zip 34 KB |
23 | VBS | Working
with Outlook folders 3/10/1998 |
Demonstrates finding a folder by name, wherever it is located on the folder tree. | code23.zip 12 KB |
28 | VBS | Updating
the message class of a form Updated 10/9/2000 |
The Reset Message Class form lets you change the message class (form) for items, to move your data to the new or upgraded form after making design changes. | code28.zip 67 KB |
43 | VBS | Parsing a
multi-line address 5/3/1998 |
Shows how to parse two address lines in a multi-line contact address into separate variables representing Line 1 and Line 2, for exporting to another application. | code43.zip 14 KB |
48 | VBS | Copying
Contact Items to Another Folder Updated 6/6/1998 |
Shows how to copy all items (or items filtered by Category) to another Outlook folder. | code48.zip 21 KB |
51 | VBS | Extracting
an Attachment from a Task and Mailing It 5/25/1998 |
Demonstrates extracting and saving an attachment from a task item and mailing it as an attachment in a new mail message. | code51.zip 29 KB |
52 | VBS | Setting
the Date and Time from Code 5/25/1998 |
Shows how to set the date and/or time for an appointment to start from VBS code, using date/time information entered in text fields on a form. | code52.zip 21 KB |
53 | VBS | Conditional
Field Validation 6/11/1998 |
Shows how to apply conditional validation to a field, based on the value of another field; the code runs from the form's Write event | code53.zip 15 KB |
54 | VBS | Find a
Text File and Mail It 6/11/1998 |
Finds a text file located in one of the standard folders, and mails it as an attachment to an Outlook mail message | code54.zip 14 KB |
55 | VBS | Display
Contacts in a Combo Box 6/11/1998 |
Displays contact names or FileAs fields in a combo box on an Outlook form, where one can be selected for further processing | code55.zip 17 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
7 | VBS VBA |
Write Outlook contact
and mail message data to an Access
table Updated 4-Dec-2004 |
This code sample includes an Outlook form and an Access database. For Office 97, the code writes most of the standard Outlook fields from the current contact item to a new row in a table in the Access database. For Office 2000 or higher, an Outlook macro (VBA procedure) runs from a toolbar button, to export both standard and custom data from any contact item or mail message. | code7.zip 280 KB |
15 | VBA | The
Outlook Automation Access 97 add-in 6/15/1999 |
An Access 97 add-in that automates importing data from custom Contact items (any Outlook version), including custom fields, into an Access 97 database. Also includes a function that generates an Access report listing all the fields in the tables in the current Access database. | code15.zip 290 KB |
16 | VBS | Export Outlook contact data to an
Access table Updated 11/27/1999 |
Exports Contact data from items in an Outlook folder to a table in an Access database, and prints a report listing the contacts. Shows the syntax for both standard and custom Outlook fields. Works with both Outlook 98/Access 97 and Outlook 2000/Access 2000. | code16.zip 79 KB |
18 | VBA | The
Outlook Automation Access 2000 add-in Updated 12/25/2001 |
An Access 2000 add-in that automates importing data from custom Contact items (any Outlook version), including custom fields, into an Access 2000 database. Also includes a function that generates an Access report listing all the fields in the tables in the current Access database. | code18.zip 221 KB |
38 | VBA | The
Outlook Automation Access 2002 add-in
12/25/2001 |
An Access 2002 add-in that automates importing data from custom Contact items (any Outlook version), including custom fields, into an Access 2002 database. Also includes a function that generates an Access report listing all the fields in the tables in the current Access database. | code38.zip 240 KB |
46 | VBA | The Safe Outlook Automation Access 2002
add-in
|
An Access 2002 add-in that automates importing data from custom Contact items, including custom fields, into an Access 2002 database. Also includes a function that generates an Access report listing all the fields in the tables in the current Access database. Uses Dmitry Streblechenko's Redemption Library to avoid the Object Model Guardian pop-ups. | code46.zip 241 KB
|
59 | VBS, VBA | Importing
Contacts from a Text File into Outlook Updated 9/26/2000 |
Shows how to import contacts from a comma-delimited text file into an Outlook Contacts folder, using Access as an intermediary | code59.zip 240 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
50 | VBS and VBA | Exporting Contacts to a Mail
Merge Document 5/18/1998 |
Demonstrates exporting contacts in a particular folder to a Word mail merge document of the Form Letters type (one letter per page), with a choice of using an Access table or a text file as the data source for the mail merge document. | code50.zip 93 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
41 | VBA | Exporting Contact Items to an Excel
Worksheet Updated 5-Sep-2007 |
Uses an Outlook VBA procedure to export all the contacts from the selected Contacts folder into an Excel worksheet called Contacts.xls, where each contact's information creates a new row. A few built-in fields are exported, plus one custom field, to demonstrate the syntax. Requires Office 2000 or higher. | code41.zip 53 KB |
47 | VBA | Exporting
Mail Items to an Excel Worksheet 5-Sep-2007 |
Uses a VBA procedure to export all the mail messages from the selected Contacts folder into an Excel worksheet called Messages.xls, where each message's information creates a new row. A few built-in fields are exported, plus one custom field, to demonstrate the syntax. Requires Office 2000 or higher | code47.zip 82 KB |
58 | VBS and VBA | Exporting
Calendar Items to Excel Updated 20-Jul-2008 |
Shows how to export Calendar items to an Excel worksheet. For Office 97/Outlook 98, an Outlook form with VBS code is used; for Office 2000 or higher, an Outlook VBA procedure is used, and you can specify a date range for filtering the appointments. | code58.zip 111 KB |
No. | VB Dialect | Title Date Last Uploaded |
Summary | File to Download |
---|---|---|---|---|
6 | VBS | Select a Word template for merging
Outlook contact data to a letter Updated 9/26/2000 |
This sample includes an Outlook form and a Word template. It demonstrates use of a Windows CommonDialog control to open a dialog where you can choose a Word template to use for creating a new letter using business or home name/address data from the current contact. | code6.zip 112 KB |
13 | VBA | Pull Outlook contact data into Word
letters 3/10/1998 |
This sample includes two Word 97 templates with AutoNew macros that pick up basic contact information from the currently open Contact item in Outlook, and paste it to either bookmarks or custom doc properties in the new Word document created from the template. Includes a discussion of the relative merits of bookmarks and custom doc properties. | code13.zip 60 KB |
29 | VBA & VBS | Time
& Expense Billing Application, Version 2
Updated 27-Jan-2011 |
A custom Outlook Journal template and several Word templates are used to create time and expense slips and generate attractively formatted Word invoices. Version 3 has separate versions of files for each Office version from 97 through 2010, plus Excel worksheets for importing slip data to other applications. For Office 2003 and 2010, there are also statements, and options for creating invoices with times to the nearest 1/10 or 1/4 hour. | code29.zip 6,347 KB
|
30 | VBS | Creating
Word Documents for Multiple Contacts Updated 5/3/2001 |
Displays contacts from a selected folder or an Access table in a multi-select listbox on an Outlook form, and generates Word documents for the selected contacts. Works in both Office 97 (with Outlook 98) and Office 2000. | 247 KB |
31 | VBA | Creating
Word Documents for Multiple Contacts with the Selection Object Updated 7/6/2001 |
Uses the Outlook 2000 Selection object to select multiple contacts for Word letters or labels. Works only in Office 2000 or higher. | 168 KB |
32 | VBA | Creating a Word
Document with Data from an Outlook Mail Message
3/25/2002 |
Illustrates two methods of getting data from an open Outlook mail message and putting it into a Word document; one uses code on a Word template’s Document_New event and the other is an Outlook 2000 VBA procedure. | 134 KB |
33 | VBA | Selecting Outlook Contacts for Word
Letters from a Multi-Select Listbox 7/16/2000 |
A multi-select listbox on a Word UserForm popped up from a templates New event lets users select contacts for a letter; letter text is picked up from the form. The TypeText method is used to write data to the letters. Works with both Office 97 and Office 2000. | code33.zip 139 KB |
34 | VBS | Exporting Outlook Contact Info to Word
Letters Updated 6/24/2000 |
This code sample exports contact name and address data from an Outlook custom contact item to a choice of three Word templates, using either a combo box or an option group. The Outlook data is stored in custom doc properties in the Word document. The CommonDialog control is not used on the Outlook form. | code34.zip 44 KB |
39 | VBS | Exporting Outlook Contact Info to Word
Letters Updated 9/26/2000 |
This sample has an Outlook form with three command buttons that use three different methods (DocProps, Bookmarks and TypeText) to insert information from an Outlook contact form to a new Word doc based on a template, using VBScript from Outlook. Three Word templates are included. (The VBScript code includes one custom field, to show the syntax for referencing Outlook custom fields.) | code39.zip 79 KB |
40 | VBA | Printing Labels with Outlook Contact
Info from Word Updated 9/26/2000 |
A Word template uses VBA code in its New event procedure to pull in all the contacts in an Outlook folder of your choice, putting one address in each cell of a table sized to print on Avery #5160 or #5162 address labels, using the Add method of the Items collection to iterate through the contacts in the folder, creating sheets of address labels for all the contacts in the folder. | code40.zip 115 KB |
56 | VBA | Getting a
Contact Address from the Address Book 7/27/1998 |
Shows how to pop up the Address Book from a Word template's AutoNew procedure; information from several fields of the selected address are stored in the document's custom doc properties, and displayed in fields on the document. | code56.zip 58 KB |