I'm using public enums in my class module so the user knows what values to select when sending an email. For these particular enums I want to make sure only one value is selected and that the value is in the enumeration list. Here are some of the Enums and variables I am using. When I try to test it in the property it is saying that I have an Invalid Qualifier. Does this mean I can only have [_first] = 0 and [_last] = # in one the the enums? If so then why can I make multiple custom variables that have components with the same name, but not multiple enums with components that have the same name?
Complie error:
Invalid qualifier
-JTBorton
Another Day, Another Disaster
Code:
Option Explicit
Option Base 1
Public Enum MsgFlagColor
'Used to set the message flag icon color. These values correspond with the outlook values.
[_first] = 0
EmEng_NoFlagIcon = 0 'olNoFlagIcon
EmEng_PurpleFlagIcon = 1 'olPurpleFlagIcon
EmEng_OrangeFlagIcon = 2 'olOrangeFlagIcon
EmEng_GreenFlagIcon = 3 'olGreenFlagIcon
EmEng_YellowFlagIcon = 4 'olYellowFlagIcon
EmEng_BlueFlagIcon = 5 'olBlueFlagIcon
EmEng_RedFlagIcon = 6 'olRedFlagIcon
[_last] = 6
End Enum
Public Enum MsgFlagStatus
'Used to set the message flag status. These values correspond with the outlook values.
[_first] = 0
EmEng_NoFlag = 0 'olNoFlag
EmEng_FlagComplete = 1 'olFlagComplete
EmEng_FlagMarked = 2 'olFlagMarked
[_last] = 2
End Enum
Public Enum MsgImportance
'Used to set message importance. These values correspond with the outlook values.
[_first] = 0
EmEng_ImportanceLow = 0 'olImportanceLow
EmEng_ImportanceNormal = 1 'olImportanceHigh
EmEng_ImportanceHigh = 2 'olImportanceHigh
[_last] = 2
End Enum
Private blnHasFlag As Boolean 'Indicates whether the message has a flag
Private intFlagColor As MsgFlagColor 'indicates the color of the flag icon
Private intFlagStatus As MsgFlagStatus 'Indicates the message flag status
Private dtFlagDue As Date 'The due date of the message flag
Private strFlagRequest As String 'A string that holds the flag request message
Complie error:
Invalid qualifier
Code:
Public Property Get Flags_FlagColor() As MsgFlagColor
Flags_FlagColor = intFlagColor
End Property
Public Property Let Flags_FlagColor(Value As MsgFlagColor)
Dim J As Integer, blnIsValid As Boolean
For J = [highlight]intFlagColor[/highlight].[_first] To intFlagColor.[_last]
If Value = J Then
blnIsValid = True
Exit For
End If
Next J
If Not blnIsValid = True Then
Err.Raise 380 'Invalid Property Value
End If
intFlagColor = Value
End Property
-JTBorton
Another Day, Another Disaster