# $ K + ContactBook Help - Table of Contents

General
	Add, Edit, and Delete addresses
	Import and Export data to/from other programs
	Nifty Things You Might Not See
	Credits, Cost, and General Mishmash
	Contacting the Author
	Future Updates

Commands
	File menu
	Edit menu
	Address menu
	View menu
	Help menu

Technical
	ContactBook Data File Format
	Troubleshooting Problems

This program is freeware and may be used by any individual or company as they see fit without charge or needing to inform the author.  This program may NOT be redistributed other than in it’s original archive, and may NOT be sold whole or in part or bundled with any other application without express, written consent of the author.

# $ K + Adding, Editing, and Deleting addresses

Adding, editing and deleting addresses is a snap, and can be done in a variety of ways.  You can select one of these options from the Address menu, click on the associated icon in the Toolbar, right-mouse click in the middle list window, or use the Insert (to add), Enter (to edit the highlit item) and Delete (to delete the highlit item) keys.

Adding and editing will bring up the address dialog box for you to go to work.  Deleting immediately removes the address from the list without warning.  No changes in all three cases are permanent until you Save the address book to the hard drive.

You can also choose the Copy command to duplicate the currently selected address in memory, which then brings up the Edit dialog.  This little shortcut will help folks who are entering many addresses with the same information, such as in a company phonebook.

Not exactly rocket science here, folks.

# $ K + Importing and Exporting data

ContactBook can handle importing and exporting data in two standard formats; comma delimited and tab delimited.  Almost any major application can import/export this particular format, making it a good solution for moving things around.

Comma Delimited
This format is the most common of the two.  Each group of items, for instance a person’s record, is contained on one line terminated by a carriage return/linefeed pair (a normal ENTER key on a PC).  Each individual item is separated from the others on the same line by a comma.  Each individual item may or may not be enclosed in quotation marks; the software which made the file will determine this factor.  This type of file is normally referred to as a CSV (Comma Separated Values) file.  Example:
“first name”,”last name”,”address 1”,
first name,last name,address 1,

Tab Delimited
More uncommon these days is the tab delimited file.  It has the same rules as the comma delimited file, with one difference; each individual item is separated from the others by a tab character.  Example:
“first name”     “last name”     “address 1”
first name     last name     address 1

Importing
When importing, data can be either placed into a brand new address book, or added to the currently open book.  If you wish a new address book, select the File, New command; to add to an existing book, first open the desired book with the File, Open command.  Next, select the File, Import command and then select the desired file to import.  If you are unsure whether to use comma or tab delimited format when importing, open the import file in a text editor or word processor first to determine it’s format.

You will then be presented with the Field Selection dialog box.  Use this dialog to inform ContactBook which columns of data belong in the desired spot in your address book.  The first line of the import file is shown at the bottom to assist you in making your choices.  If you do not wish to import data to a certain field in ContactBook, simply set the number to 0 (zero) and it will be ignored.  After you select OK, the import process will begin and you’ll be done!  Don’t forget to use the File, Save command to save your imported data to the hard drive.

Exporting
All data in the currently open address book will be exported to the desired format; ContactBook does not yet support select data exporting.  If you need only a certain set of data exported, open the export file afterwards and edit in a text editor or word processor to suit your needs.  Some day I wish to add “tagging” of certain records for such selective operations.

Exporting looks almost the same as importing; first, select File, Export to select which format you wish the resulting file to be in.  Enter a new filename as appropriate; if you select an existing file, it will be overwritten, not have the new information added.  The Field Selection dialog will then appear, allowing you to select which items in the address book you wish to export.  As with the Import procedure, set a field to 0 (zero) to have ContactBook ignore it.  Select OK and let the magic begin.  ContactBook always encloses each individual item on a line in quotation marks, in order to preserve embedded spaces and the like.

# $ K + Nifty Things You Might Not See

There are a few things in ContactBook that are not readily apparent unless you go looking for them; here are a few pointers:

•	You can ‘drag-n-drop’ the Columns to arrange the order; left mouse click on a header (the gray area at the top of the list that looks like a button), hold down the mouse button and start to drag the column to the new position.  You will see little arrows indicating exactly where the column will go when you let go of the mouse button.
•	You can change the column sizes by clicking on the little black line between headers (see above) and simply moving left/right.  A bar will appear showing you where the width will be when you let go of the mouse.
•	The Sort order (and which column!) is indicated by a little triangle shaped arrow show in a header.  By default the Sort Order is Ascending, Last Name.  You can click on any column to sort on that column, and if you click a second time the sort order will reverse itself (Ascending to Descending and vice-versa).
•	You can open an existing file by using the familiar drag-drop approach; if ContactBook is minimized to the Taskbar (not the System Tray!) you can drag a document (*.CBD) onto the program and it will automatically load.  Likewise, if you have .CBD files associated in Windows with ContactBook, double-clicking on a .CBD file will automatically launch ContactBook with that file.
•	Try right mouse clicking, or double-clicking, in the list of addresses instead of using the menu bar; you’ll probably find it a lot more handy to navigate around.

# $ K + Contacting the Author

These are the current locations you need.  As anything on the net, they may change at any time, but in general they’ve been the same for years:

Email:		tengel@sonic.net
WWW:	http://www.sonic.net/~tengel

# $ K + Future Updates

The biggest question on everyone’s mind is ‘What about Printing?!?’  Well, my good people, it’s definitely underway.  The basic code to handle printing is actually in there, but I am having major problems getting it to do what I want.  I’ve even had the help of a few other well respected programmers, but to no avail; once it’s figured out, printing will be a reality in ContactBook.

# $ K + Credits, Cost, General Mishmash

Credits
•	I would like to thank Julian Smart for his Cexpr routines used for data storage and retrieval.  They are simply perfect for this small program.  Excluding the minor modifications I made to suit my needs, it’s a good out-of-the-box package for MFC programmers who need a quasi-database.  Currently you can reach Julian at: http://web.ukonline.co.uk/Members/julian.smart.

•	I would also like to thank all the fine folks at MFC Programmer’s SourceBook, a Website devoted to MFC programming.  I gain a lot of information (and in some cases direct code) from here, and fully appreciate the work Zafir puts into maintaining the site.  You can find the site at: http://www.codeguru.com.

Cost
ContactBook is currently freeware, with no plans to ever charge for it.  Simply put, it’s been created around my needs, and I want to pass it on to the community.  Source code is not available, but I am open to helping you with a programming problem, should you like a certain feature I’ve done.  I’m also open to suggestions in code optimization to make the application faster - if you see something you’ve also coded (but faster) gimme a yell and we’ll chat.

# $ K + File menu commands

The File menu offers the following commands:

New	Creates a new document.	
Open	Opens an existing document.	
Save	Saves an opened document using the same file name.	
Save As	Saves an opened document to a specified file name.	
Import	Imports a tab or comma delimited format ASCII file.	
Export	Exports a tab or comma delimited format ASCII file.	
Recent Files	Opens a recently used Address Book.	
Exit	Exits ContactBook.	

# $ K + Edit menu commands

The Search menu offers the following commands:

Find	Find a person by First or Last name.	
Find Again	Repeat the last Find operation.	
Preferences	Configures ContactBook preferences.	

# $ K + Address menu commands

The Address menu offers the following commands:

Add	Adds a new address.	
Edit	Edits the selected address.	
Delete	Deletes the selected address.	
Copy	Duplicates the selected address.	
Dial	Dials a number for the selected address.	
Email	Sends email to the selected address	
Web	Launches Web page for selected address	

# $ K + View menu commands

The View menu offers the following commands:

Toolbar	Shows or hides the toolbar.	
Status Bar	Shows or hides the status bar.	
Flat Toolbar	Displays Flat mode toolbar.	
Save Window Size	Saves the current window size.	
Save Column Widths	Saves the current column sizes.	
Save Column Positions	Saves the current column positions.	

# $ K + Help menu commands

The Help menu offers the following commands, which provide you assistance with this application: 

Help Topics	Offers you an index to topics on which you can get help.	
About	Displays the version number of this application.	

# $ K + New command 
(File menu)

Use this command to create a new document in ContactBook

You can open an existing document with the Open command.

# $ K + Open command 
(File menu)

Use this command to open an existing document in ContactBook.

You can create new documents with the New command.

# $ K + File Open 
(Dialog box)

The following options allow you to specify which file to open:

File Name
Type or select the filename you want to open.  This box lists files with the extension you select in the List Files of Type box. 

List Files of Type
Select the type of file you want to open.  Only one kind of document can be opened in ContactBook format.  See Import command for importing comma and tab delimited files.

Drives
Select the drive in which ContactBook stores the file that you want to open. 

Directories
Select the directory in which ContactBook stores the file that you want to open.

Network...
Choose this button to connect to a network location, assigning it a new drive letter. 

# $ K + Save command 
(File menu)

Use this command to save the active document to its current name and directory.  When you save a document for the first time, ContactBook displays the Save As dialog box so you can name your document.  If you want to change the name and directory of an existing document before you save it, choose the Save As command.

# $ K + Save As command 
(File menu)

Use this command to save and name the active document.  ContactBook displays the Save As dialog box so you can name your document.  

To save a document with its existing name and directory, use the Save command.

# $ K + File Save As 
(Dialog box)

The following options allow you to specify the name and location of the file you're about to save:

File Name
Type a new filename to save a document with a different name.  A filename can contain up to eight characters and an extension of up to three characters.  ContactBook adds the extension you specify in the Save File As Type box.

List Files of Type
Select the type of file you want to open.  Only one kind of document can be opened in ContactBook format.  See Export command for importing comma and tab delimited files.

Drives
Select the drive in which you want to store the document.

Directories
Select the directory in which you want to store the document.

Network...
Choose this button to connect to a network location, assigning it a new drive letter. 

# $ K + Import command 
(File menu)

Use this command to import a data file in comma or tab delimited format.  ContactBook first displays the Open dialog box allowing you to select the desired file, and then displays the Select Fields dialog box allowing you to choose the destination fields for your incoming data.

Comma Delimited
Import a data file in the standard CSV (comma separated value) format, which is normally one of the following:
“first name”,”last name”,”address 1”,
first name,last name,address 1,

Tab Delimited
Import a data file in the standard TDF (tab delimited file) format, which is normally one of the following:
“first name”     “last name”     “address 1”
first name     last name     address 1

# $ K + Export command 
(File menu)

Use this command to export a data file in comma or tab delimited format.  ContactBook first displays the Save As dialog box  for you to type a desired name for the destination file, and then displays the Select Fields dialog box allowing you to choose the position layout for your exported data.

Comma Delimited
Export a data file to the standard CSV (comma separated value) format.  ContactBook uses one format:
“first name”,”last name”,”address 1”,

Tab Delimited
Export a data file to the standard TDF (tab delimited file) format.  ContactBook uses one format:
“first name”     “last name”     “address 1”

# $ K + File Select Fields 
(Dialog box)

This dialog is used for both importing and exporting data within ContactBook to allow you to choose column layout and data positioning.

Import
When importing a comma or tab delimited file, you must choose the destination fields in which to place the incoming data.  To ignore a field, set it’s numerical position to 0 (zero).

Export
When exporting data to a comma or tab delimited file, you must choose the order in which they will appear for each line.  To exclude a field from export, set it’s numerical position to 0 (zero).

# $ K + 1, 2, 3, 4 command 
(File menu)

Use the numbers and filenames listed at the bottom of the File menu to open the last four documents you closed.  Choose the number that corresponds with the document you want to open.

# $ K + Exit command 
(File menu)

Use this command to end your ContactBook session.  You can also use the Close command on the application Control menu.  ContactBook prompts you to save documents with unsaved changes.

# $ K + Find command 
(Edit menu)

Use this dialog to search for a person by either First Name or Last Name.  You can search backward and forward in the list, use case sensitivity, and start at the top of the list.  You can also use the QuickFind on the Toolbar to search for a person using the last search criteria.  See Find Again to continue the search.

# $ K + Find Again command
(Edit menu)

This command is used to repeat the last search, and is dependant upon the search criteria.  If you had selected to start at the Top of the list, Find Again becomes rather useless.  Otherwise, it will continue from the present location and locate the next person matching your search string.  See Find to do an initial search.

# $ K + Preferences command
(Edit menu)

This option brings up the Preferences dialog where you can configure various options for ContactBook.  ContactBook settings are stored in the CB32.INI file located in the same directory as the program.  If you experience problems after configuring a certain setting, simply delete this file to restore to the default states.  If you’ve got nothing better to do, you can look around in there at the saved settings.

General Settings

Last Address Book
ContactBook will reopen the last address book used.
Last Sort Used
ContactBook will automatically set the sort order to the last column sorted on.
Column Widths
The last configured column widths will be used each time ContactBook starts up.  You can configure columns two ways; either by using the mouse and dragging the column headers to the desired size, or by using the Column Widths tab in the Preferences dialog.
Column Positions
The order in which you have configured the columns will be used each time ContactBook starts.
Import Settings
The last comma or tab delimited import settings will be retained for future imports.
Export Settings
The last comma or tab delimited export settings will be retained for future exports.
Window Size
ContactBook will resize itself to the last used window position and size each time it is started.
Confirm Deletes
Each time you delete and address from ContactBook a simple dialog will be shown to verify that in fact you did wish to delete the entry.
Show on File Menu
ContactBook will display the most recently used address books on the File menu.
Address Books
Select how many recently used address books to show on the File menu if the above option is selected.
Default Data
Fill out the fields in this section to speed the entry of a new address within ContactBook.  Each time you add an address, these items will be filled in for you, ready to go.
Minimize to Tray
Select this item to have ContactBook minimize to the System Tray as an icon rather than taking up space on the Taskbar.  Left click on the Tray Icon to restore ContactBook, right click on the icon to bring up a menu of options.
Start Minimized
This item will start ContactBook minimized to the System Tray; a very handy option if you have ContactBook in your Startup group in Windows.

Column Widths

You can configure the widths of the individual columns to suit your needs.  If you set the column width of an item to 0 (zero), the item will not appear in the list; however, the data is still there if you double-click on an address or select to edit it in one of the various ways.  You can also click on the Reset button to restore the sizes back to the defaults I have chosen.  Handy if you make a real mess of things.

Column Order

You have the ability to decide in which order you would like to display the columns in ContactBook.  Select one of the fields and then choose Move Up or Move Down to rearrange the list.  Again, a nifty Reset button is available if you make a mess of your settings.

# $ K + Add command
(Address menu)

Use this menu command to insert a new address into the currently active address book.  You must use the Save command to commit all additions to the address book to the hard drive.

# $ K + Edit command
(Address menu)

Use this menu command to edit the address currently selected in the list view.  This option is disabled if no address is selected or the address book is empty. You must use the Save command to commit all changes to the address book to the hard drive.

# $ K + Delete command
(Address menu)

Use this menu command to delete the address currently selected in the list view.  This option is disabled if no address is selected or the address book is empty. You must use the Save command to commit all deletions to the address book to the hard drive.

# $ K + Copy command
(Address menu)

The Copy command will take the currently selected address and create a duplicate of it in memory.  It will then automatically bring up the Edit dialog, allowing you to change the necessary items; this feature is handy if you are entering multiple address for the same location, such as for a Business.  To cancel the Copy once started, simply press Cancel in the Editing dialog.

# $ K + Dial command
(Address menu)

The Dial command will attempt to use your installed TAPI device (such as the Dialer app which ships with Windows95/NT4) to initiate a voice call to one of the phone numbers for the selected address.  If the phone number slot you pick is empty, ContactBook will prompt you for the missing information before proceeding and give the option of updating the selected address with this new information.

# $ K + Email command
(Address menu)

The Email command will create an Internet Shortcut for the selected email address in the current address, and then attempt to launch the shortcut.  In order for ContactBook to be able to initiate an email to an address, your system must have a mail application installed which is configured in the Registry to handle the mailto protocol.  If you do not have such an application installed, Windows will inform you with a message dialog box.  Eudora is a good example of a mail application which handles the mailto protocol.  The actual file contents might look like the following:

[InternetShortcut]
URL=mailto:tengel@sonic.net

# $ K + Web command
(Address menu)

The Web command will create an Internet Shortcut for the selected URL in the current address, and then attempt to launch the shortcut.  In order for ContactBook to be able to initiate a URL for an address, your system must have a web browser installed which is configured in the Registry to handle the http protocol.  If you do not have such an application installed, Windows will inform you with a message dialog box.  Internet Explorer and Netscape are good examples of web browsers which handle the http protocol.  The actual file contents might look like the following:

[InternetShortcut]
URL=http://www.sonic.net/~tengel

# $ K + Save Window Size command
(Configure menu)

This menu option will write the current window size and screen position to the configuration file.  These values will then be used the next time you start ContactBook if you have select to use Window Size in the Preferences dialog.

# $ K + Save Column Widths command
(Configure menu)

This menu option will write the current column widths to the configuration file.  These values will then be used the next time you start ContactBook if you have select to use Column Widths in the Preferences dialog.

# $ K + Save Column Positions command
(Configure menu)

This menu option will write the current positions (order) to the configuration file.  These positions will be used the next time you start ContactBook if you have selected to use Column Positions in the Preferences dialog.

# $ K + Toolbar command 
(View menu)

Use this command to display and hide the Toolbar, which includes buttons for some of the most common commands in ContactBook, such as File Open.  A check mark appears next to the menu item when the Toolbar is displayed.

See Toolbar for help on using the toolbar.

# $ K + Toolbar
{bml hlptbar.bmp}

The toolbar is displayed across the top of the application window, below the menu bar.  The toolbar provides quick mouse access to many tools used in ContactBook.

To hide or display the Toolbar, choose Toolbar from the View menu.

# $ K + Status Bar command 
(View menu)

Use this command to display and hide the Status Bar, which describes the action to be executed by the selected menu item or depressed toolbar button, and keyboard latch state. A check mark appears next to the menu item when the Status Bar is displayed.

See Status Bar for help on using the status bar.

# $ K + Status Bar
{bml hlpsbar.bmp}

The status bar is displayed at the bottom of the ContactBook window.  To display or hide the status bar, use the Status Bar command in the View menu.

The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus.  This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them.  If after viewing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button.

The right areas of the status bar indicate which of the following keys are latched down:

Indicator	Description
CAP	The Caps Lock key is latched down.
NUM	The Num Lock key is latched down.
SCRL	The Scroll Lock key is latched down.

# $ K + Flat Toolbar command
(View menu)

The Flat Toolbar command allows you to toggle the appearance of ContactBook’s display of the main toolbar.  By selecting Flat mode, it will have the appearance of the newer programs, such as Internet Explorer and Word98.  This feature does not require IE or any other app to be installed for it to work (many programs do).  The Flat Toolbar appearance is completely custom drawn in homebrew MFC code.

# $ K + Help Topics 
(Help menu)

Use this command to display the opening screen of Help.  From the opening screen, you can jump to step-by-step instructions for using ContactBook and various types of reference information.  

Once you open Help, you can click the Contents button whenever you want to return to the opening screen.

# $ K + About command 
(Help menu)

Use this command to display the copyright notice and version number of your copy of ContactBook.

# $ K + Data File Format

ContactBook uses a text file to actually store data, rather than a binary file.  This has both advantages and drawbacks; an advantage is the file is human readable that you can edit, change, save, etc should you ever need to do so.  A drawback is the loading and saving of large address books and/or slow machines may take a bit longer.  Once the data file is loaded the information is manipulated completely in memory, rather than continual modifying of a disk file.

The format is extremely simple; each entry has a node name of contact, and each item of the node is defined in the standard key=value way as shown below.  A sample is worth a thousand words - you should be able to understand how it works without a problem.

contact('LastName' = "Smith",
  'FirstName' = "John",
  'MiddleInitial' = "A",
  'Title' = "Mr.",
  'Address1' = "1234 Harm’s Way",
  'Address2' = "",
  'City' = "Topeka",
  'Country' = "USA",
  'State' = "KS",
  'ZipCode' = "99999",
  'Company' = "",
  'Department' = "",
  'Position' = "",
  'Manager' = "",
  'Additional1' = "",
  'Additional2' = "",
  'HomePhone' = "(800) 555-1212",
  'HomeExt' = "",
  'WorkPhone' = "(976) 123-4567",
  'WorkExt' = "113",
  'CellPhone' = "",
  'CellExt' = "",
  'Pager' = "823-5567",
  'PagerCard' = "1910182",
  'PagerExt' = "",
  'FaxPhone' = "",
  'FaxExt' = "",
  'Email1' = "john@nowhere.com",
  'Email2' = "",
  'Web1' = "http://www.nowhere.com/~john",
  'Web2' = "",
  'Notes' = "Birthday: 12 Jan 1960").

# $ K + Troubleshooting Problems

You just may encounter a few problems while running ContactBook; please make sure to check all the items here before emailing me; I thank you in advance.

Importing Files causes a GPF
This most wonderful problem is almost always caused by the incoming file.  Basically, a comma/tab delimited file is designed to be a certain way; one item per line, each line has the correct amount of things (i.e., all have XX number), and each is terminated by a carriage return + linefeed pair.  Now, just because that’s how it’s *supposed* to be doesn’t mean everyone always does this; Outlook 97 is a good example.  Outlook allows you to have ENTER keys (carriage return/linefeed) in the fields.  When exporting a file, Outlook sends it verbatim - blamo! - bad file.  Open your file and you’ll notice that you have embedded garbage all over the place, uneven lines, and so forth.  I am not going to waste my time writing code to look for junk like this; please simply edit your file that’s being Imported to clean it up and make it nice, like the rest of the world.

My Configuration is Messed Up
If you’ve been working with Column Widths and Column Positions and completely just destroyed what you have, it’s very simple to fix.  You can either A) delete your CB32.INI file or B) go into the Preferences and click on Reset in the Widths/Order pages.

The Dial Feature is Not Working
To get a phone number to dial in Win95/NT, you have to install a ‘dialer’ application; basically, it's all magic the way it's done.  In Windows, there is an API Microsoft invented called "TAPI" == Telephone Applications Programming Interface.  They way it works is this:  you have to have two ends, one end sending the telephone request, the other end listening for the request.

ContactBook is the first end -- in the ContactBook code, I make a TAPI request to Win95/NT to dial a phone number xxx-xxx-xxxx on the ‘default’ telephone device (Windows figures out which is the ‘default’).  Then, when Windows receives this request it looks for the program to handle it -- the ‘dialer’.  The Dialer then simply dials the phone number and does what you think.

So, if it's not working for you, one of two things is wrong:
A) no program (a.k.a. ‘dialer’) is installed, so no one is listening for the request, or
B) the program is installed, but not working quite right.

Windows comes with the ‘dialer’ program (formally called "Phone Dialer"), and usually makes an icon for it on the "Accessories" menu on your Start Menu.  You install it from the Control Panel, Add/Remove Programs, Windows 95/NT Setup (tab), Communications.  Try unchecking the dialer box (if checked), then closing all the windows -- it may ask you to reboot after doing some work.  Then, go back in there and re-check the Phone Dialer, and Windows should install it again when closing the windows.  Make sure to have your Win95/NT CD ready, as it may be required.

The Email/Web Feature is Not Working
ContactBook uses the email and web applications installed as ‘default’ under Windows; if you’ve ever run Navigator or Internet Explorer, you’ve seen the question asking if you want to set the default to (their product).  There is no way to specify in ContactBook which application to use for email and web usage; this must be done via the applications themselves.  If your email/web application does not support configuring itself as a ‘default’ application under Windows 95/NT, write to the author(s) and request they make this simple addition in their code for you.

No Help Available

No help is available for this area of the window.