Wednesday, May 5, 2010

Upadte Existing Outlook Forms

Issue: You have a bunch of Outlook forms in a folder and you want to update them to a new form layout.

Quick: Download Omsgclas.exe utility

Visual/Learning:
As an example you might have a bunch of help desk forms stored in a folder.  Over time the form layout may change to make the form easier to use.  The problem is that if you need to open an old form the layout is not updated automatically but is the old, harder to use version of the form. 
Microsoft has a knowledge base article on how to fix this (Update existing outlook forms to a new form)
and utility to help as well.

--------------Here is a snipit of text from the Microsoft page on how to do this with a script as well -----
Create a VBScript routine


There are three tasks to this solution.

Create a new item to store the VBScript code.

Enter the VBScript code and save the form.

Run the VBScript code.

Back to the top

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.

Back to the top

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



' Change the following line to your new Message Class

NewMC = "IPM.Contact.MyNewForm"



Set CurFolder = Application.ActiveExplorer.CurrentFolder

Set AllItems = CurFolder.Items

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.

Back to the top

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.
 
------  End of Snipit from Microsoft page --------------

No comments: