ID: Q187554
The information in this article applies to:
If you use Microsoft Visual Basic for Applications or Visual Basic Scripting Edition (VBScript) to sort a collection of items based on a user- defined field, the items may not be sorted.
You used square brackets to delimit the name of the user-defined field.
Do not use square brackets around the user-defined field. Do not use the following syntax to sort a collection of items based on a user-defined field:
MyItems.Sort "[Contact Type]", False
Instead, use the following syntax
MyItems.Sort "Contact Type", False
where Contact Type is the name of a user-defined field.
The Sort method is not designed to function with user-defined fields. Although the workaround described in this article works in all known cases, Microsoft does not support its use.
Also, this functionality may not exist in future versions of Outlook, raising the risk that your solution may not function correctly in the future.
This problem does not occur when using a standard, or pre-defined, Outlook field.
For more information about creating solutions with Microsoft Outlook, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q180826
TITLE : OL98: Resources for Custom Forms and Programming
ARTICLE-ID: Q182349
TITLE : OL98: Questions About Custom Forms and Outlook Solutions
Additional query words: OutSol OutSol98
Keywords : kbdta OffVBS
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbpending
Last Reviewed: April 20, 1999