FMS Home FMS Software Development Team Blog FMS Facebook Page FMS Twitter
Jump: Search:

Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access 2007/2010 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2010 (32 bit), 2007, 2003, 2002, 2000, and
Visual Basic 6.0!

Also available for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

 

 
Royalty free source code library modules for Microsoft Access, VB6, VBA, OfficeRoyalty free source code library modules for Microsoft Access, VB6, VBA, OfficeVBA and VB6 Source Code Library Download the free trial version of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA

Complete List of Modules and Classes in Total Visual SourceBook for Microsoft Office/Access, VBA, and VB 6

Total Visual SourceBook includes 194 modules/classes with 100,000+ lines of royalty-free source code you can use immediately in your Microsoft Access, Excel, Office, VBA, and Visual Basic 6 (VB6) projects. Here's a complete list of every module and class included in Total Visual SourceBook along with a brief description of each. Click on the module name for a complete list of procedures.

Access: Automation

Working with an instance of Access through Automation

CAccessAutomation Working with the Access Object Model through Automation

Most of the functionality available in Access can be called from an external program, such as one written in Visual Basic 6 or Excel. This class contains methods and properties that show you how to get to database objects in an Access database.
 

Access: Environment

Access application, ADP, and startup routines, managing the Access window, printers, ribbons, status bar, and Microsoft Visual SourceSafe

modAccessWindow Windows APIs to show and hide the Access window and controls
modADP Routines for running an Access Data Projects (ADPs)
modApplication Access application level routines for managing the database window, login information, and closing Access
modInformation Information on the current Access database's handle, type, version, etc.
modPrinter Manage the printer settings and orientation on Access forms and reports
modRibbons Manage the Access Ribbons to show, hide, minimize, maximize, and toggle it
modStartup Startup routines for an Access application
modStatusBar Manage the Access status bar and progress meter
modVisualSourceSafe Working Microsoft Visual SourceSafe from Access
 

Access: Forms

Access Forms working with data in ACCDB, MDB, and ADPs, subforms, and spell checking

modAccessSpellChecker Launching the Microsoft Access spell checker on an Access form and its subforms
modForms General routines for Microsoft Access forms (Jet and ADP)
modForms_ADP Routines for Microsoft Access forms in ADPs
modForms_Jet Routines for Microsoft Access forms using Jet (for MDB/ACCDB, not ADP)
modSubForms General routines for Microsoft Access subforms (Jet and ADP).

These functions will also work with normal forms, however, we are showing how to do additional things like: - Subclassing a subform in order to discern when an event on a subform fires. The example code here is all that is necessary for this since we do not need to create an additional class to accomplish this task. - Prevent adding records to a subform if it has met a maximum number of records with the AllowDisallowAdditionsToForm and GetRecordCount functions.
 

Access: Macros and Modules

Access Macros and modules

modMacros Retrieving Microsoft Access macro names and running them
modModules Compiling, opening, retrieving, replacing, saving, and deleting Microsoft Access modules
 

Access: Objects

Access Objects

modCurrentProject Get, set, and create Access properties for the CurrentProject (Jet or ADP database)

This is different from the Jet/DAO databases properties
modDataOperations Perform data operations through DAO.

Although queries should be considered the primary mechanism for working with data in Access, there are many places where complex needs eliminate queries as an option.
modManagingObjects Delete, duplicate, rename, and export Access objects in Jet and ADP databases
modMSysObjectsInfo Retrieve Access object information from the MSysObjects table
modObjects Manage open Access objects, inventory, active objects, and minimizing, restoring and closing them

Supports the current Jet database or Access Data Project (ADP)
 

Access: Reports

Access Reports

modReports Managing Microsoft Access reports to design, preview, print, report view, output to PDF, etc.
 

Active Server Pages: Active Server Pages

Active Server Pages (ASP)

Basic ASP Code This item contains basic Active Server Pages how-to and example code
Downloads and ContentType Code to work with browser downloads and the ContentType attribute
File and Disk Code for working with files and disks using ASP.
HTML Forms Basic code for working with HTML forms
Security Security code snippets
 

ActiveX Controls: Multimedia

Multimedia ActiveX Controls

modWindowsMediaPlayer Routines for working with the Windows Media Player control
 

ActiveX Controls: Windows Common Controls

Windows Common Controls for list view and tree view

CListViewEnh Class that provides access to the enhanced features of the MS ListView common control.

This class acts as a wrapper for the common dialog ListView control. It provides several useful enhancements such as full-row select and sorting when the user clicks the column header when the listview control is in report view. It allows you to specify additional styles such as check boxes, and gridlines, as well as functions to set and get the value of the check boxes. Note that you must insert a ListView control onto a form in order to create a reference to the common controls library before the class will compile.
modListView Routines to extend the functionality of the VB6 ListView control.

The majority of the ListView enhancements are provided in the CListViewEnh class. This module contains a standalone procedure to load a DAO recordset into a ListView control.
modTreeView Loading the TreeView Windows Common control with data and searching.

The TreeView control is one of the components in the comctl32.ocx common controls custom control. It presents an expandable/collapsible hierarchical view of data. The routines in this module are used to load the treeivew from arrays and recordsets, find strings, and collapse and expand the nodes of the treeview.
 

Database: Access/Jet

Microsoft Access Jet databases and their objects (MDB and ACCDB database formats)

CADOConnJet Class to support client/server operations using ADO.

This class supports client/server operations using Microsoft's ActiveX Data Objects (ADO) technology. When using Visual Basic to deploy data-oriented local or client/server applications, you have a variety of development choices. You can use DAO and Jet, DAO and ODBC Direct, RDO and the Remote Data Control, or program directly against the ODBC API. This class exposes functionality to use ADO against Microsoft Jet data sources using the native Jet OLE DB driver. For information on the other choices, see the other classes in the Database category.
CADOConnJetODBC Class to support client/server operations using the ADO feature in VB 6.0.

This class sets up an ADO connection object for use with a Microsoft Jet database. It uses the Jet ODBC driver rather than the Jet OLE DB driver.
CJetData Properties and methods for working with data stored in Jet/Access databases using DAO.

When you use VB to develop database applications, you have several choices for local database access: 1. Use the Data Control to access Jet/Access databases. 2. Write DAO code to work against Jet/Access databases. 3. Use DAO/Jet with linked tables for heterogeneous data access to disparate data sources such as FoxPro, xBASE and Excel. The functionality in this class enhances method #2, the use of DAO and Jet in program code to work with data.
CJetDatabase Using DAO with Microsoft Access Jet database objects

Microsoft Jet contains a versatile Database object that represents an open database. The term "database" is a broad term that can represent any one of the following: - A Jet or Access Database (.mdb, .mda) - A Jet workgroup information file (.mda, .mdw) - An ODBC database, represented by a DSN - A file system directory, such as a directory of xBASE or Paradox files This class works with DAO/Jet objects at the database level. The class itself maps on top of a Jet/Access database and provides methods and properties for working with the objects contained in that database.
CJetEngine Manage Access database characteristics such as passwords, encryption, compact, workspaces and tuning through DAO

The Microsoft Jet Database engine is exposed through the Data Access Objects (DAO) interface as the DBEngine object. Through this object, you can set various engine-wide parameters, and work with Jet workspace and database objects. This class puts a layer of high-level functionality on the Jet engine. You can use the properties and methods in the class to perform engine-level operations, such as database maintenance, setting performance tuning options, retrieving low-level statistics, and setting workgroup options for secured databases.
CJetLinkedTables Working with Microsoft Jet Linked tables using DAO

This class exposes methods and properties for working with Microsoft Jet Linked (attached) tables. Microsoft Jet provides a powerful mechanism for accessing external data sources. This technique, called "Linking" (or attaching in Access 2/Jet 2 terminology) allows you to create a permanent link to an external database or file. A variety of data sources are supported: - Microsoft Access/Jet databases - dBASE DBF files - Paradox DB files - FoxPro DBF files - Excel spreadsheets - HTML Import And Export - Text Files - Exchange data stores - ODBC data sources Links are useful because they make the external data source appear as a standard table in the database. This makes the management of data across disparate sources easy, and since links can cache structure information about the external data source, accessing the data is usually faster than opening the external data source each time.
CJetODBC Class to support client/server operations using Microsoft Jet to manage the ODBC layer

This class supports client/server operations using Microsoft Jet to manage the ODBC layer. When using Visual Basic to deploy client/server applications, you have a variety of development choices. You can use DAO and Jet, DAO and ODBC Direct, RDO and the Remote Data Control, or program directly against the API. This class exposes functionality to use DAO and Jet against ODBC data sources. For information on the other choices, see the other classes in the Database category. Many client server applications developed using Microsoft Access and Visual Basic use the DAO/Jet method for remote data access. Using Microsoft Jet, you make calls to the remote server using standard DAO procedures. Microsoft Jet manages the translation between the MDB file format objects and the server objects.
CJetRecordset Working with Microsoft Jet recordsets with DAO

With this class you can open and close recordsets on a variety of data sources, and get advanced information about records and fields.
modADOJetADOX Code that shows how to work with Jet/Access objects and information using the ActiveX Data Objects (ADO) object model.
modADOJetData Example code to work with table and query data in a Jet/Access database using the ActiveX Data Object (ADO) object model
modAttachmentFields Working with Attachment fields in Access ACCDB databases
modJetDatabase Creating and setting primary Access database characteristics
modJetDatabaseSecure Modifying Access database settings under workgroup security
modJetObjectInfo Detailed information on individual Jet/Access objects using the Data Access Objects (DAO) object model
modJetSecurity Manage Jet security users and groups in a specified database.

Each of the procedures in this module require that you pass a workgroup name to identify the workgroup you want to work with. By default, Visual Basic doesn't open a workgroup information file (*.MDA, *.MDW) unless you specify the SystemDB property of the DAO DBEngine object. When you specify a value for this property, the default DAO Workspace object, also known as Workspaces(0) is mapped to the workgroup information file you specify. In such a case, specifying a blank value for the strWorkgroup parameter of the procedures in this module effectively uses whatever workgroup information file you are currently using.
modJetTableInfo Access/Jet table information
modMultiValueFields Working with MultiValue fields in Access ACCDB databases
modQueriesADO Create, execute, and browse Microsoft Access queries in the current project using ADO for MDB, ACCDB and ADP formats
modQueriesDAO Create, execute, and browse Microsoft Access queries using DAO/Jet
modSnippetADOJetADOX Example code that shows how to work with Jet/Access data using the ActiveX Data Objects Security and DLL extensions (ADOX) object model
modSnippetADOJetData Example code that shows how to work with Jet/Access data using the ActiveX Data Objects (ADO) object model
modSnippetDAOParity_Data Shows a comparison of using common data access activities against Jet table data using the DAO and ADO methods.

While most Access and VB projects that use Jet use the DAO object model, new extensions to ADO make it possible to use ADO instead. This module shows common DAO tasks and then shows the equivalent ADO code.
modSnippetDAOParity_DDLEngine Shows a comparison of using common data access activities against Jet object structures using the DAO and ADO methods.

While most Access and VB projects that use Jet use the DAO object model, new extensions to ADO make it possible to use ADO instead. This module shows common DAO tasks and then shows the equivalent ADO code.
modSnippetDAOParity_Security Shows a comparison of using common data access activities against Jet security using the DAO and ADO methods.

While most Access and VB projects that use Jet use the DAO object model, new extensions to ADO make it possible to use ADO instead. This module shows common DAO tasks and then shows the equivalent ADO code.
modSnippetQueries Example code that shows how to browse queries objects as recordsets in a Jet/Access database using the Data Access Objects (DAO) object model.
modTableCopyDAO Copy table structures (including complex fields) between tables using DAO
modTableCopyDataADO Copy records (excluding complex fields) using ADO
modTableCopyDataDAO Copy records (including complex fields) between tables using DAO
 

Database: SQL Server

Working with SQL Server database objects

CADOConnODBC Class to support client/server operations using ADO with any ODBC connection

This class sets up an ADO connection object for any ODBC connection. Use this connection if a native OLE DB driver is not available for your data source.
CADOConnSQLServer Class to support SQL Server operations using ADO

This class sets up an ADO connection object for use with a Microsoft SQL Server database using the native OLE DB driver.
CRDOConnection Class to support client/server operations using the Remote Data Access to set up an ODBC connection to a data source.

When using Visual Basic to deploy client/server applications, you have a variety of development choices. You can use DAO and Jet, DAO and ODBC Direct, RDO and the Remote Data Control, or program directly against the API. This class exposes functionality to use RDO against ODBC data sources. For information on the other choices, see the other classes in the Database category. This class was designed and tested against an ODBC connection using Microsoft SQL Server. The behavior with other servers may be slightly different.
CRDOData Class to support client/server operations using Microsoft's Remote Data Objects (RDO) technology.

This class uses an existing rdoConnection to perform queries, create resultsets, execute stored procedures etc. When using Visual Basic to deploy client/server applications, you have a variety of development choices. You can use DAO and Jet, DAO and ODBC Direct, RDO and the Remote Data Control, or program directly against the API. This class exposes functionality to use RDO against ODBC data sources. For information on the other choices, see the other classes in the Database category. This class was designed and tested against an ODBC connection using Microsoft SQL Server. The behavior with other servers may be slightly different.
modADOSQLServer Working with SQL Server via ADO
modDataLinkDialog Open the Data Link Properties dialog to get ADO connection strings for sources like SQL Server
modSnippetADOSQLServerRst Example code that shows how to work with SQL Server recordsets via ADO
 

Excel: Automation

Excel automation

CExcel Working with Microsoft Excel through Automation.

Microsoft Excel provides and automation server component, which allows most of the functionality in Excel to be called from an external program (e.g. VB6, Access VBA, etc.). This class contains methods and properties that show you how to work with Excel.
 

Excel: General

Examples of code running within Excel

modSnippetAutoFilter Working with Excel AutoFilter objects.

Excel allows you to filter cell data using the Filter, AutoFilter menu item. You can also access and create AutoFilter objects through VBA code. This module contains examples to access, modify, and use these AutoFilter objects.
modSnippetExcel Working within Excel
modSnippetQueryTable Working with Excel Query Table Objects

Excel makes it easy to insert data from other applications using Query Tables. You can also access and create Query Table objects through code. This module contains example code to show you how to programmatically work with Query Table objects.
 

General VBA/VB6: Abstract Data Types

Abstract Data Types such as bit arrays, dictionary, history lists, queues, and stacks

CBitArray Class that implements a bit array.

A bit array is an array of bit values, defined as 0 or 1. This class allocates 1 bit for each value you wish to store, resulting in significant memory savings. For example, suppose you wanted to maintain an array of 100 Boolean values. A single Boolean requires 2 bytes of memory, resulting in 200 bytes of memory. Using the bit-array technique available with this class, only 13 bytes of memory are consumed. A zero in the bit array would represent False, and a 1, True.
CDictionary This class demonstrates using the dictionary object

Visual Basic 6 includes the Windows Scripting Host runtime component. This dynamic link library adds the ability to create and use Dictionary objects, which are similar to VB Collections, but are more powerful and can also be used in VBA. Unfortunately, several things are lacking in the dictionary object, and the documentation provide with VB 6 for this new object is thin at best. This class accomplishes three things: 1. Works around the bugs in the version of the Windows Scripting Runtime that ships with VB 6 2. Provides detailed examples of how to use the dictionary object. 3. Provides additional functionality such as sorting the dictionary.
CHistoryList Class that implements a history list.

If you have ever used a web browser, you are already familiar with the concept of a History List. When you press your browser's Back button, you return the previous page you viewed. Similarly, when you press the Next button, you move to the page after the one you are currently on. This class implements the History List mechanism as a set of two stacks: a forward stack and a backward stack. The forward stack contains items that have been popped off the history list, whereas the backward stack contains items that have been pushed onto the history list. By maintaining these two stacks, the class keeps a history list that allows you to move back and forth through a history of items.
CQueue Class that implements a bounded queue.

A queue is a restricted form of a list. All insertions occur at the end of the list, and all deletions at the front. The queue data type defines three operations, EnQueue, DeQueue, and Front. - EnQueue places an item at the rear of the list - DeQueue removes an item from the front of the list - Front retrieves, but does not remove, an item from the front of the list The queue is a FIFO, or First-In, First-Out, data type. This means that data enters at one end of the list, and exits from the other. A common example of a queue is a waiting line, such as the ticket window at a movie theater. The last person to enter the line is the last person to be served at the front of the line. This class is implemented using an array based approach. Wraparound indexes are used for the array. When the array becomes full, the array index is reset to the beginning of the array. This class supports object variables in addition to the standard text and numeric types.
CStack Class that implements a stack.

A stack is a restricted form of a list. All insertions and deletions occur at one end of the list. The stack data type defines three operations, Push, Pop, and Top. - Push places an item on the top of the list - Pop removes an item from the top of the list - Top retrieves, but does not remove, an item from the top of the list The stack is a LIFO, or Last-In, First-Out, data type. This means that data enters and exits from the same end of the list. An example of a stack is a spring loaded plate dispenser in a cafeteria. The last plate placed in the dispenser is the first one removed. This class is implemented using an array based approach. When the array becomes full, the array is grown by the amount specified in the GrowBy property. This class supports object variables in addition to the standard text and numeric types.
 

General VBA/VB6: Application Techniques

Common application development code for messages boxes, error handling, and shutting down windows

CMsgBox Wrapper class to simplify using Message Boxes.

Coding MsgBox statement throughout your application can be a drudge. You have to specify all the parameters for your message box as parameters, and add a bunch of bits together to specify attributes. This class solves that problem by providing a very simple wrapper over the MsgBox command that exposed the message box as a set of properties and actions.
CShutdown Shutting down Windows with options to restart and logoff

This class allows you to shutdown Windows in one of four ways: - Shutdown - Restart - Logoff - Shutdown with Power Off
CVBAErrHandler Global Error Handler for VBA.

This class provides a standardized error handling mechanism to trap errors, track the location and type of the errors, and to allow the programmer to take appropriate response. This version is VBA compatible--it contains no VB-specific code. If you want a VB-specific version, use the CErrHandler class available under Visual Basic, Application Techniques.
modMessageBox Routines for simplifying using the built-in msgbox function.
 

General VBA/VB6: Clipboard Operations

Windows Clipboard Cut, Copy, and Paste

modClipboard Working with the Windows Clipboard

Use this code to get the contents of the clipboard, copy text to the clipboard, or clear the contents of the clipboard.
 

General VBA/VB6: Data Integrity

Data integrity verification using 16 and 32 bit CRC (Cyclic Redundancy Check)

CCRC16 Calculate the 16-bit CRC of a file or string
CCRC32 Calculate the 32-bit CRC of a file or string
 

General VBA/VB6: Data Type and Unit Conversion

Convert among different types of data such as bit operations, units of measure

modBitOps Routines for bitwise and unsigned data manipulation.

Visual Basic does not provide any native methods for performing bitwise manipulation, nor does it provide unsigned data types. This module remedies those limitations with routines for bit shifting, setting and clearing bits, unsigned assignment operations, and extracting components of variables.
modDataConversion Convert data and numbers to data types and strings such as binary, hex, nulls, and currency
modUnitConversion Convert units of measurement such as degrees, distance, volume, and calendar dates
 

General VBA/VB6: Date and Time

Date and time routines, including business day math

CBusinessDatesFile Business day math (taking holidays into account) with holidays stored in a file
CBusinessDatesTable Business day math (taking holidays into account) with holidays stored in a table
CMMTimer Simulate the action of a stop watch by using a high-resolution timer

This class uses a high-resolution multi-media timer to track elapsed time. This class is useful for timing user operations, or for bench-marking your applications. Because it uses the Windows multimedia timer, it uses much higher resolution than the built-in VB Timer function.
modDateTime

See sample Date Time code

Date and time calculations including add and subtracting dates, age, day of week or month, quarters, ISO week numbers, etc.

VBA/VB6 provides many useful functions for dealing with date and time values. This module contains code that enhances these functions, with code for adding and subtracting dates, handling weekdays, finding the next or previous day, checking for leap years, determining ages, calculating differences between dates/times, and more.
modYear2000 Year 2000, four digit year displays
 

General VBA/VB6: Encryption and Compression

Encryption and compression operations

CEncryption Class that encrypts and decrypts a file or string.

This class is Unicode enabled. There are methods included for encrypting both files and strings. This class uses XOR password encryption. The password is also encrypted as the string or file is processed, providing an additional level of security.
CHuffman Class that implements Huffman compression.

Huffman compression uses character frequencies to compress data. Bit codes are assigned to each character, with shorter bitcodes for more common characters, and longer bitcodes for the less common characters.
CLZ Class that implements Lempel-Ziv compression.

LZ compression, also known as sliding window compression, uses redundancy to compress data. As input data is read, a dictionary of previous data is kept in memory. If a string of characters in the input data matches an entry in the dictionary, a code pointing to the dictionary entry is written to the output. If a match is not found in the dictionary the plain character is sent to the output.
CRLE Class that implements run length encoding.

This Run Length Encoding algorithm reduces strings of recurring characters to a single character, followed by a count of how many times the character occurred.
CUUEncode Class that encodes and decodes files using UU Encoding.

UU Encoding is an algorithm for converting binary data to 6-bit ASCII. This is often needed to send binary files through internet mail gateways. UU Encoding is also commonly used in internet newsgroups for posting binary data. UU Encoding breaks a group of 3 eight bit characters (24 bits) into 4 six bit characters (also 24 bits) and then adds 32 (a space) to each six bit character. This maps it into a transmittable character set. These characters are: !"#$%&'()*+,-./ 0123456789:;=? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
 

General VBA/VB6: File and Disk Operations

Managing disk drives, files, paths, folders, and subfolders with and without Windows API calls

CAPIDisks Working with disk drives using the Windows API

Although Visual Basic has rudimentary file and disk functionality, you must go to the Windows API to get real power in this area. This class exposes logical drives through a collection of properties and methods, including support for: - Enumerating all logical drives. - Getting drive information such as volume label, free and total space, serial number and more. - Determining if a drive is ready. - Changing a volume label.
CShellExecute Class that uses the Windows Shell to launch, print, or explore files or programs.

The routines in this class allow you to use the Windows shell to perform a variety of file execution operations. For example you can copy a file or group of files and have the Windows shell provide an animated progress display. You can send files to the Recycle Bin with full confirmation support.
modAPIFilesAndPaths Working with drives, paths, and files using the Windows API
modFileDisk File, directory and disk manipulation routines to copy, delete, and move files, folder and subfolders

Visual Basic offers many built-in commands and functions for working with files and disks.
modShellFileDisk Windows shell routines to work with folder and disk.

The Windows Shell user interface exposes its functionality through a variety of functions exported from the SHELL32.DLL library. This module makes it easy to use this functionality in your applications.
 

General VBA/VB6: Fonts

Fonts stored in Windows and their sizes

modFont Enumerating the fonts installed on the system, and converting between points and height
 

General VBA/VB6: Help Files

Managing Help files (*.HLP and *.CHM formats)

CWinHelp Working with Windows Help (*.hlp) files.

Code is included for opening, searching and closing help files. You can also open "Help on Help", contents pages, the help index, and run macros stored in help files. Many of the Office and Visual Basic products provide tools for searching and displaying help files, but the VB solution is based on the use of the Common Dialog control. If your application is already using the Common Dialog control, it makes sense to use the Help facilities that VB offers. However, if you aren't using this control, and you need to implement support for Windows Help, this class is a better solution. Its size is obviously much smaller than the Common Dialog control, and its operation is very simple.
modHelpHTML Working with Windows HTML Help files (usually named *.CHM or *.HTML)
 

General VBA/VB6: INI File

Working with Initialization (*.INI) files

modINIFile Windows Initialization (INI) files

Initialization (INI) files are the primary mechanism that 16-bit Windows programs use to store setting information. Additionally, Windows itself stores its settings for the most part in various INI files in the Windows directory. Even in the 32-bit world, INI files are still used. This category contains procedures to read and write INI file values in both the built-in Windows files and your own custom INI files. Windows splits INI file access into two categories: 1. INI Operations: all operations are hardcoded to go to the WIN.INI file located in the Windows directory. 2. Private INI: all operations work on the INI file specified in the call. Use the "private" INI functions to work with all INI files other than WIN.INI. Interestingly, you can use the "private" INI functions on WIN.INI by specifying WIN.INI as the file to work with.
 

General VBA/VB6: Math

General math and routines for area and volume, statistics, and trigonometry

modMathAreaVolume Math routines for determining the area and volume of various objects
modMathGeneral General math routines such as rounding, factorials, and determining the minimum and maximum values from a set of numbers

The code in this module also addresses rounding errors that exist in VBA functions. VBA has built-in functions for various mathematical operations. Search online help for "Math Functions" and "Derived Math Functions" for more information.
modMathStatistics Mathematical functions covering the areas of statistics and probability.

This category contains various math routines covering the areas of statistics and probability. VBA has built-in functions for various mathematical operations. Search online help for "Math Functions" and "Derived Math Functions" for more information
modMathTrigonometry Trigonmetry functions for working with values such as cosines, tangents and secants
 

General VBA/VB6: Multimedia

Multimedia support for AVI and WAV files, CD and MIDI devices, and telephone/modem TAPI

CAVI Class that plays AVI files using the MCI (media control interface) API

This class allows you to interact with AVI movies without using the Microsoft Multimedia Control. This class also allows you to play movies on your form. With the Microsoft Multimedia Control you can only play movies in a separate window.
CCD Class to provide an interface for controlling a CD player without using the Microsoft Multimedia Control
CWAVMID Class that plays wav and midi files using the MCI (media control interface) API.

This class allows you to interact with WAV or MIDI files without using the Microsoft Multimedia Control. In addition, this class allows you to record WAV files.
modMultimedia Routines for working with multimedia devices.

The module contains miscellaneous multimedia functions dealing with waveform audio files. The routines allow you to play or stop playing Windows .WAV files, to get and set the volume levels for wave devices, and to determine whether your user's machine supports waveform audio.
modTAPI Dialing numbers with the modem via Telephony Application Programming Interface (TAPI)
 

General VBA/VB6: References

Managing Library References

modReferences Manage library references from VBA projects
 

General VBA/VB6: Registry

Managing the Windows System Registry

CProgramSettings Simplified registry access routines used for saving program settings.

This class is designed to store information about a single program to a single location in the Windows registry. Typically it is used to store program-specific run-time settings or switches such as form locations, or most-recently-used menu items.
modRegistry Routines for manipulating the registry (add, edit, delete, enumerate, and find registry keys and values)
 

General VBA/VB6: Searching and Sorting

Searching in and sorting strings and arrays

CBoyerMoore Class that implements Boyer-Moore string searching.

The Boyer-Moore string-searching algorithm provides a highly optimized method for searching for a sub-string within a string. The Boyer-Moore algorithm takes advantage of its knowledge of the string being searched for. By doing this, it is possible to search a string without examining all the characters in the string.
CFuzzyStringSearch Fuzzy string searching
CMetaPhone Class that implements the metaphone string searching algorithm.

The metaphone algorithm is similar to the soundex algorithm but tends to group names together that are more closely related than soundex does. However, metaphone also tends to produce more matches than soundex. Similar to soundex, the metaphone algorithm generates a key value for a word based on the consonants in that word. Metaphone uses more intelligent transformation rules, though, by examining groups of letters, or diphthongs.
modSearch Search routines
modSort Array sorting routines
 

General VBA/VB6: String Handling

String handling to concat, evaluate expressions, use tokens, and parse strings

CConCat High performance concatenation of large strings

When concatenating large strings on the order of 50kb or larger (for example, building an RTF string), the length of time to complete becomes exponentially longer. This is because Visual Basic re-allocates the string each time it is concatenated. This class implements an alternative to normal concatenation that does not re-allocate the string each time it is concatenated.
CExpressionEvaluator Class to implement expression evaluation.

Expression evaluation is a common need in many programs, especially if you deal with numbers and operators.
CTokenizer Breaking and parsing a string into individual tokens

This tokenizer is implemented as a state machine. The characters used for whitespace, separators, quotes, and end-of-line are all implemented as properties. This allows for a great deal of flexibility in how text is tokenized.
modStrings Manipulate, parse, clean, capitalize and count strings
 

General VBA/VB6: System Information

System information for the computer, keyboard, memory, mouse, operating system, printers, and system folders

CComputerInfo Obtaining computer system information
CKeyboardInfo Managing keyboard settings
CMemoryStatus Class that retrieves memory status information
CMouseInfo Manage the mouse and its properties
COSInfo Obtaining operating system information
modMouse Control the mouse icon
modPrinter-Windows Working with the Windows printer settings
modSystemFolders Retrieve and create system and user folders
 

General VBA/VB6: Windows Common Dialogs

Displaying Windows Common Dialogs for Colors, Files, Folders, Fonts, Printers, and Page Setup

CColorDialog Displaying the Choose Color Common Dialog
CFileDialog Displaying the File Open/Save Common Dialog
CFontDialog Displaying the Font Common Dialog without using the Microsoft Common Dialog Control
CPageSetupDialog Displaying the Page Setup Common Dialog
CPrintDialog Displaying the Print Common Dialog without using the Microsoft Common Dialog Control
modBrowseForFolder Open the Windows Browse for Folder dialog
 

General VBA/VB6: Zip Codes

Lookup City and State values from a zip code lookup table using DAO and ADO

CZipCode_ADO Class that uses a zip code table to lookup a zip code's corresponding City and State.

FMS, in conjunction with the USPS, offers a monthly subscription to current US zip codes. See http://www.fmsinc.com/MicrosoftAccess/ZipCodeDatabase.html for details.
CZipCode_DAO Class that uses a zip code table to lookup a zip code's corresponding City and State.

FMS, in conjunction with the USPS, offers a monthly subscription to current US zip codes. See http://www.fmsinc.com/MicrosoftAccess/ZipCodeDatabase.html for details.
 

Internet/Web: HTTP/FTP

Code to work with Internet protocols such as HTTP and FTP (File Transfer Protocol), and working with the Internet Transfer control

CInternetFTP Working with the FTP standard to get to data, connections and sessions on a remote FTP site

You can use the functionality in this class to connect to an FTP server, get file directories and information, create directories, and send and receive files. This class works directly through the WININET.DLL library, so it requires no additional OCX or control files. This means you can distribute simple FTP functionality with your application with little overhead.
CInternetHTTP Working with HTTP connections, data, and sessions

You can use the functionality in this class to query HTTP servers, request and send data, and manage HTTP sessions. This class works directly through the WININET.DLL library, so it requires no additional OCX or control files. This means you can distribute simple HTTP functionality with your application with little overhead. WININET.DLL is part of Internet Explorer.
 

Internet/Web: Internet/Web

Using Maps and Twitter on the web

modMapping Routines for launching addresses or getting directions with online web mapping services Bing, Google, and MapQuest
modTwitter Code to post and retrieve messages from your Twitter account
 

Office: Automation

Office Automation

modOfficeCommandBars Routines for working with command bars in Microsoft Office applications and files
 

Outlook: Automation

Microsoft Outlook Automation

COutlookAddressBook Working with the Microsoft Outlook Address Book and the Exchange Server Global Address List through Automation
COutlookCalendar Working with Microsoft Outlook Calendars through Automation
COutlookContacts Working with Microsoft Outlook Contacts through Automation
COutlookFolders Working with Microsoft Outlook Folders through Automation
COutlookMail Working with Microsoft Outlook Mail Items through Automation
COutlookNotes Working with Microsoft Outlook Notes through Automation
COutlookTasks Working with Microsoft Outlook Tasks through Automation
 

PowerPoint: Automation

Working with an instance of a PowerPoint presentation through Automation

CPowerPoint Class that provides a set of methods and properties that make it easy to start working with PowerPoint through automation.
 

SharePoint: Databases

Working with Access databases on SharePoint

modSharePointDatabases Routines for working with Access databases on SharePoint
 

Visual Basic 6: Application Techniques

VB Application Techniques

CCommandArgs Class to parse information contained in a string into individual parts that can be tested
CErrHandler Class that provides a standardized error handling mechanism to trap errors, track the location and type of the errors, and to allow the programmer to take appropriate response
CHourglass Wrapper class that implements an alternative way to show an hourglass.

One of the problems that can arise when using an hourglass is not setting the cursor back to the default. This class avoids that problem by automatically setting the cursor back to the default when it terminates.
modVB_Application Routines for working with VB modules and IDE.

This includes handling chores such as ensuring that all forms in the application are closed before exiting, and testing the open status of forms in your and other applications.
 

Visual Basic 6: Controls

Code for working with VB6 controls

CDateTimePicker Implement the DateTime Picker Windows common control

This class implements routines for creating and manipulating the date time control from Internet Explorer's common control library.
CIPAddressInput Class that implements the IP Address Input Windows common control.

This class implements routines for creating and manipulating the IP Address control in the Internet Explorer common control library. This class requires version 4.71 or later of COMCTL32.DLL. Please note that you cannot simply redistribute COMCTL32.DLL with your application.
CValidateControl Class that provides the ability to perform validation on controls in their LostFocus events

Many people assume that it is easy to perform validation for VB controls in the LostFocus event. Actually this can be quite a problem. Consider the scenario where you have two text boxes, Text1 and Text2. Both have code in their LostFocus events which checks to see that valid data was entered. When the user tabs out of Text1, the LostFocus event fires, so the programmer displays a message box and attempts to set the focus back onto Text1. However before focus can be set to Text1, Text2 will receive a GotFocus event, and a LostFocus event. Unless the value in Text2 is already correct, the validation code in Text2 will fire, and the user will be stuck in an endless loop. This class keeps a state variable which tracks whether a validation test is currently being performed. If a validation routine for Text1 is being performed, Text2 will NOT fire its validation messages, even if the validation for Text2 fails.
modComboBox Routines to extend the functionality of a standard VB ComboBox control.

Some of these procedures expose features which are inherent in the Windows control, but are not exposed by VB (such as the ability to set the drop-down list width). Other procedures add entirely new functionality such as loading a DAO recordset into an unbound combo box.
modListBox Routines to extend the functionality of the standard VB ListBox control.

Some of these procedures expose features which are inherent in the Windows control, but are not exposed by VB (such as the ability to set add scrollbars or to set the height of items in the list.) Other procedures add entirely new functionality such as loading a DAO recordset into an unbound list box.
modTextBox Routines to extend the functionality of the standard VB TextBox control.

Some of these procedures expose features which are inherent in the Windows control, but are not exposed by VB (such as the ability to set a bounding rectangle, or to force input to a certain case). Other procedures add entirely new functionality such as filtering keystrokes, or selecting text.
modToolBar Routines for manipulating toolbars.

Set the toolbar to the flat style, the same style as Visual Basic toolbars. This functionality is not built into the Windows Common Control ActiveX Control.
 

Visual Basic 6: Forms

Working with Forms in VB6

CCaptionlessWindowMover Class that allows the user to move a form with the mouse, even if it doesn't have a caption.

If you create a form without a caption bar, there is normally no way for the user to move it with a mouse. If you wish to allow the user to move the form with a mouse by dragging on any part of the form, not just the caption, you can use this class to handle the mouse-related events required to make this happen.
CFormPos Form Position Handler class to perform various functions relating to the position of a form on a screen.

You may save a form's position to the Windows registry, and restore a form to its previously-saved position. You may center a form, or move it to a specified location. This class uses the Windows registry to store information about the forms. You may specify any location of the registry by specifying the location with the RegistryPath and RootKey properties.
COpenForm Class that open Forms via a string reference.

Visual Basic does not allow you to open and show a form based on a string or a variable containing the name of the form. This class lets you create a collection of the forms in your application, and then refer to them via strings or variables.
modVB_Forms Routines to enhance the behavior and features of VB forms
 

Visual Basic 6: Graphics

Creating graphics using the Windows API and native VB6 commands

CChangeRes Changing monitor screen resolutions

This class supports functionality to list all available video modes and switch to the desired mode. Since some mode changes require a shutdown of Windows, this is also supported.
CGDIArc Class that draws an arc, using Windows API GDI calls.

An arc is a line segment of an ellipse. The routines in this class allow you to draw the arc by calling the Windows API Arc function.
CGDIChord Class that draws a Chord, using Windows API GDI calls.

A chord is a region bounded by the intersection of an ellipse and a line segment, called a "secant"). Imagine an arc whose end-points are connected by a straight line.The routines in this class allow you to draw the chord by calling the Windows API Chord function.
CGDIEllipse Class that draws an ellipse, using Windows API GDI calls.

An ellipse is a circle or oval region whose center is located in the middle of an imaginary bounding rectangle. The routines in this class allow you to draw the ellipse by calling the Windows API Ellipse function.
CGDIFloodFill Class that fills an area using Windows API calls.

The Windows API FloodFill function fills a region of the form or picture which is bounded by a solid line of pixels of the same color. It is often used to "color in" parts of the form. The routines in this class allow you to use the Windows API FloodFill function.
CGDILine Class that draws a line, using Windows API GDI calls.

A line is a series of pixels drawn between two points on the screen. The routines in this class allow you to draw the line by calling the Windows API LineTo and MoveToEx functions.
CGDIPie Class that draws pie segments, or a complete pie, using Windows API GDI calls.

A pie segment is wedge bounded by the intersection of an ellipse and two radials. The ellipse is drawn within an imaginary bounding rectangle. This class uses the Windows API Pie function to draw the pie segments.
CGDIPolygon Class that draws a polygon, using Windows API GDI calls.

This class lets you draw an arbitrary polygon made up of a collection of straight-line segments, whose end-points are specified by the X and Y position in pixels. Specify the number of points in the polygon by setting the PointCount property. Then set the points between 1 and PointCount to valid X and Y point positions. The routines in this class allow you to draw the shape by calling the Windows API DrawPolygon function.
CGDIRectangle Class that draws a rectangle, using Windows API GDI calls.

A rectangle is a region whose location is determined by the Left, Top, Right and Bottom properties of this class. The angles of the corners of the rectangle are always drawn at 90 degrees. The routines in this class allow you to draw the rectangle by calling the Windows API Rectangle function.
CGDIRoundRect Class that draws a rounded rectangle, using Windows API GDI calls.

A rounded rectangle is a region whose location is determined by the Left, Top, Right and Bottom properties of this class. The angles of the corners of the rectangle are always drawn at 90 degrees. The corners of the rectangle are rounded off based on the value of the Height and Width properties. The routines in this class allow you to draw the rounded rectangle by calling the Windows API RoundRect function.
CScreenCapture Screen capturing windows and forms to a picture
modFractal Routines for drawing fractals, including the Mandelbrot and Julia fractals
modGraphics Routines for creating graphics, primarily with Windows API calls.

The majority of the procedures in this module enhance VB's built-in graphics handling capabilities by allowing you to call routines in the Windows API to create graphical effects on your forms and other objects. Routines such as GradientFill, DrawControlEdge and RotateText actually place graphical objects on your forms. Other routines in this module perform numerical or calculated transformations only, or retrieve graphical information, such as the TranslateVBColor, GetRedValue and GetPixelColor functions. These functions do not produce any output, but they are useful helper functions for working with VB graphics.
modSimulatedControls Routines to draw simulated controls.

Windows contains a function "DrawFrameControl" to create an image of several standard Windows "widgets" -- check boxes, menu items, scroll bar controls and so forth. The functions in this module expose this function to your application. You might want to use these simulated controls for several reasons. Perhaps you are creating documentation of the appearance of a form, and you wish to create a graphic you can display or print. You might be creating lightweight "graphical" user controls and wanting to draw the appearance of the controls on your user control rather than using an actual control. Because the controls are drawn by Windows, their appearance depends on the users' Windows color and font preferences.
 

Visual Basic 6: Menus

Visual Basic 6 Menu objects

CMRU Class that handles processing of "Most Recently Used" menu items on a form.

This class is commonly used to store the "Most Recently Used" file list for menu items on a form, but the list of items does not have to be a list of files. It could be used for any unique items you wish to store and display on a form's menu.
modMenus VB6 menu routines
 

Visual Basic 6: Printing

Print using the Windows API and native VB6 commands

CAPIPrinter Working with the printer using the Windows API
modVB_Printer Enhanced features for working with Printers in VB6
 

Word: Automation

Microsoft Word Automation

CWord Working with Microsoft Word through Automation

Word includes full support for interacting with Word as an automation server, and for working with documents. This class supplies several high-level methods that make it easy to work with Word and Word documents.
 

XML: XML DOM

XML Parsing and Display

CXMLADO Class to Convert an ADO Recordset to XML using the Microsoft XML Parser.

This class allows you to convert an ADO Recordset to a XML document or load a XML document created with this class, back into an ADO Recordset.
CXMLSettings Saves and reads application settings to and from a XML File
CXMLTreeView Class to populate a Microsoft TreeView control with the contents of an XML file by using the XML Document Object Model (as provided through the Microsoft XML Parser components).

Note: Due to Limitations of the treeview you will receive errors if the treeview node count exceeds 32767
modSnippetXML Example code that shows create, read, and search an XML document


Additional Resources

Return to Main Total Visual SourceBook Page

 

Feedback

Contact Us  l   Web questions: Webmaster   l   Copyright FMS, Inc., Vienna, Virginia
Celebrating our 27th Year of Software Excellence