Visual Basic Technique

Basically you have 2 .OFT files:

1. Special.oft - a special screen design - for example ACT!.oft or Goldmine.oft

2. ChangeMessageClass.oft - to apply the special screen file above

Download the ChangeMessageClass.oft
in to a folder such as "C:\Program Files\Microsoft Office\Templates\Outlook"
and run it.

1. Disable Macros - to edit the Change

This Edits an existing VBScript Code

  1. Tools, Forms, Design This Form - takes you to the design mode

  2. Form, View Code - allowsyou to change the Visual Basic Code

  3. File, Close

  4. File, Save As...  make a new, or over-write the previous OFT file

2. Enable Macros - to run the Change

Enable Macros This applies the form to all the records in the Outlook Contacts folder

Create a New Item to Store the VBScript Code

  1. On the File menu, point to New, and then click Mail Message.
  2. On the Tools menu, point to Forms, and then click Design This Form to enter form design mode.

Enter the VBScript Code and Save the Form

  1. On the Form menu, click View Code.
  2. In the Script Editor, type the following code. You do not need to enter the lines that begin with an apostrophe, since these lines are comments that are ignored when executed.
    Sub Item_Open

       Dim NewMC As String
       Dim CurFolder As Outlook.MAPIFolder
       Dim CurItem As Outlook.ContactItem 
       Dim I As Integer

       Set CurFolder = Application.ActiveExplorer.CurrentFolder
       Set AllItems = CurFolder.Items

       ' Change the following line to your new Message Class
       NewMC = "IPM.Contact.MyNewForm"
       NumItems = CurFolder.Items.Count

       ' Loop through all of the items in the folder
       For I = 1 to NumItems

          Set CurItem = AllItems.Item(I)

          ' Test to see if the Message Class needs to be changed
          If CurItem.MessageClass <> NewMC Then

             ' Change the Message Class
             CurItem.MessageClass = NewMC

             ' Save the changed item

          End If


       MsgBox "Done."

    End Sub

  3. On the File menu, click Close.
  4. On the File menu, click Save As. Make sure the default setting for file type is Outlook Template (.oft), and then select a location to save the file. Enter a file name for the form and then click OK.
  5. Close the item by clicking the X in the upper-right corner of the item window and then click No when prompted to save changes.

Run the VBScript Code

  1. Open the folder that contains the items you wish to update.
  2. To run the VBScript code, open the item again by using Windows Explorer to locate the file and then double-click the .oft file. The code will run automatically because it was entered into an Item_Open event procedure. If you receive a macro warning, click Enable Macros.
  3. Wait while the code changes the message class for all of the items in the currently selected folder. Depending on the number of items, this may take several minutes. When the code finishes, you should receive a message that says Done.

NOTE: If you wish to edit the VBScript code later to change the name of the message class, hold down the SHIFT key when you open the item. This prevents the VBScript code from executing and you can go into design mode, make changes to the VBScript code, and save the form.

How To Customize Screens

How To Change Form for an Existing Record

Outlook Screen Customization and Design   Utility