Custom Message Types

You can install up to 1000 custom message types in Mail. A custom message type is a special type (or class) of message for delivery between two or more Mail recipients or Mail-enabled applications. A custom message type can define a particular way to perform standard Mail operations such as composing, replying to, and forwarding messages. Custom message types can define a message's appearance and content, or the behavior of the forms displayed to the user when sending, reading, and replying to messages of that type.

Most custom message types are received in your Inbox just like standard mail messages. A second kind of custom message type doesn't appear in the Inbox when it arrives and yet is available to other Mail-enabled applications. This allows Mail-enabled applications to define their own message classes.

Custom message types have many similarities to custom commands. Like custom commands, a command for composing a custom message type can be added to a Mail menu. When the Mail user chooses this command, the custom message type DLL displays a dialog box or form that enables the user to compose a message of the corresponding type. These dialog boxes or forms can include features specific to the message type.

When a custom-type message arrives in a Mail folder, it can appear in the message list the same as other standard mail messages. But when read or replied to, the custom dialog boxes or forms associated with the message type can be displayed in place of the standard read or reply form. You can also design a custom message type that doesn't appear in Mail's Inbox when it arrives and yet is available to other Mail-enabled applications.

Note If a custom message type is delivered to a user who does not have that custom message type installed, the message is treated as a standard message type.

Custom message types can provide special messaging functionality such as the following:

Microsoft Schedule+ is an example of an application that defines its own custom message types. Schedule+ uses the following custom message types:

For more information, see "Custom Message Types for Schedule+" in Chapter 9, "Microsoft Schedule+."

Installing Custom Message Types

Installing a custom message type is similar to installing a custom command. Just like custom commands, you can install custom message types on an individual computer or on the postoffice as shared custom message types. Typically, though, you will install them as shared custom message types because you will want both sending and receiving parties to take advantage of the custom message type.

When you install custom message types on an individual computer, you must modify the Registry on that computer by adding a custom message type entry in this key:


HKEY_CURRENT_USER\Software\Microsoft\Mail\Custom Messages

For information about how to do this, see "Custom Messages Entries for Mail" in Chapter 14, "Registry Value Entries."

For shared custom message types, you must add a custom message type entry to the postoffice's SHARED32.INI file. Then, on each workstation using the shared custom message type, you must add a SharedExtensionsDir entry in the Microsoft Mail subkey Registry. As with custom commands, when Mail sees this entry in the Registry, it reads SHARED32.INI for custom message type entries before reading custom message type entries in the Registry.

Installing Custom Message Types on the Postoffice

To install a shared custom message type on the postoffice, follow these steps:

  1. Create a shared Mail extensions directory on the postoffice.
  2. Copy the SHARED32.INI file and custom message type DLL (and/or .EXE) to the shared extensions directory.
  3. Add custom message type declarations to the [Custom Messages] section of the SHARED32.INI file on the postoffice, using this syntax:

    MessageClassName=Mail version; menu name; command name;
    command position
    ; ExtsDir DLL name; ExtsDir command string;
    operation map
    ; status text; ExtsDir Help file name; Help context;

Note The message type declarations should be a single command line in the SHARED32.INI file. Do not add any carriage returns even if line-wrapping occurs.

Values are defined in the following table.

Value

Definition

class

A string uniquely identifying the message type. Mail places this string in messages and calls custom message DLLs based on its value.

Mail version

Identifies the version of Mail in which the custom message is compatible.

menu name

Indicates the menu where the custom command for the message type is to be added, such as File or Mail.

command name

The command name that is to appear on the menu. As usual, you may include an ampersand (&) just before the letter that is to serve as an ALT+ key accelerator.

command position

The zero-relative position within its menu at which the command is to appear. A value of -1 places the command at the end of the menu.

ExtsDir DLL name

The name or path of the DLL in which the custom message resides.

command string

The Command string passed as one of the parameters to the DLL entry point for the command.

operation map

A sequence of up to 16 digits. Each can be 0, 1, or 2. 0 indicates that Mail is to perform its standard operation on the custom message. 1 indicates that the DLL is to be called to handle the operation. 2 indicates that the operation is to be completely disabled. Currently, eight operations are defined; the rest are reserved and must be zero. In the following list, 0 is the leftmost digit:

0 Compose (menu command defined in this entry)

1 File.Open

2 Mail.Reply

3 Mail.Reply to All

4 Mail.Forward

5 File.Print

6 File.Save as

7 Arrival of new mail

status text

Text to be displayed in the Mail status bar when the user moves the cursor to the command in the menu.

ExtsDir Help file name

The Windows NT Help file to be invoked when the user presses F1 while the command is selected. The specified filename is passed to the Windows NT help program. (This value is optional.)

Help context

Passed to the Windows NT help program along with the Help file name. Use -1 (Help file index) if there is no specific entry in the Help file for this command. (This value is optional.)

There is one special token that may appear within certain fields:

<ExtsDir>

Expands to the value of SharedExtensionsDir in the user's Registry. Used to refer to DLLs that are installed in a shared extensions directory on the network. Valid for the DLL name, command, and Help file subfields.


  1. In the Registry on your computer, add a SharedExtensionsDir entry to reference the shared extensions directory in the following key:

    HKEY_CURRENT_USER\Software\Microsoft\Mail\Microsoft Mail

    For information about how to do this, see "Microsoft Mail Entries" in Chapter 14, "Registry Value Entries."

  2. If you have chosen the manual connection method, make the necessary network connection using File Manager.
  3. Quit Mail if it is running, and then restart it.

    Mail rereads your Registry and adds the shared custom message to the specified menu.

  4. Restart Mail and test the shared custom message type.
  5. When the custom message type works successfully on your computer, modify each user's Registry to have access to the shared extensions directory. (See step 4.)