OL98: SetColumns Returns Incorrect Value for Boolean Field (184786)
The information in this article applies to:
This article was previously published under Q184786 SYMPTOMS
You use the SetColumns method in the Microsoft Outlook 98 object model and
get unexpected results when working with a boolean (True/False) field.
CAUSE
When you use the SetColumns method with a boolean field, the value returned
for True is incorrect and will cause unexpected results if used with a
logical statement such as If...Then...Else.
WORKAROUND
Use either of these two work arounds:
- Do not use the SetColumns method to increase performance when accessing
boolean fields.
- Use the SetColumns method with the boolean field, but alter your code
so that it takes this into account. Using SetColumns, a field set to
True will return a value of 1 instead of -1. Use this syntax to ensure
that condition evaluates properly:
The following syntax will return an incorrect result:
If Item.Complete = True Then
NOTE: You should not use the following syntax since it will cause your
code to fail when this problem is fixed in a later version of Outlook:
If CInt(Item.Complete) = 1 Then
STATUS
Microsoft has confirmed this to be a problem in Microsoft Outlook 98.
REFERENCES
For more information about creating solutions with Microsoft Outlook 98,
please see the following articles in the Microsoft Knowledge Base:
180826 OL98: Resources for Custom Forms and Programming
182349 OL98: Questions About Custom Forms and Outlook Solutions
| Modification Type: | Minor | Last Reviewed: | 3/1/2004 |
|---|
| Keywords: | kbbug kbpending kbProgramming KB184786 |
|---|
|