Article ID: 184786
Article Last Modified on 3/1/2004
APPLIES TO
- Microsoft Outlook 98 Standard Edition
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
Additional query words: OutSol OutSol98 VBScript Yes No On Off
Keywords: kbbug kbprogramming kbpending KB184786