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
-
Tools, Forms, Design This Form - takes you to the design mode
-
Form, View Code - allowsyou to change the Visual Basic Code
-
File, Close
-
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
- On the File menu, point to New, and then
click Mail Message.
- 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
- On the Form menu, click View Code.
- 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
CurItem.Save
End If
Next
MsgBox "Done."
End Sub |
- On the File menu, click Close.
- 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.
- 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
- Open the folder that contains the items you wish to update.
- 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.
- 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.
https://www.experts-exchange.com/articles/4317/Mass-Change-Outlook-Contacts-to-Use-a-New-Form.html
http://docmessageclass.zip/ Utility