G
Guest
This is really a general VBA problem but it's come up in Outlook so I thought
I'd post it here. Is there any way of testing for an empty property, i.e.
one that's been set to Nothing? I've tried all the functions like IsEmpty,
IsNull, IsMissing, etc but I've ended up having to settle for a rather clumsy
error routine that catches error 91.
The particular case in which I'm having problems is using Redemption: in the
CurrentItem_PropertyChange event (for ThisOutlookSession module) I've set the
SafeItem equal to the CurrentItem but for some reason the SentOnBehalfOfName
doesn't come across, even though I've preceded this line with a
CurrentItem.Save (the strange thing about this is that it worked fine when
run in the CurrentItem_Send event - I guess it's something to do with trying
to save an entire message before one of its properties has been updated). As
a work around, I'm using SafeItem.Sender.Name (a property I spotted in the
Locals window while stepping through the code). This works fine unless the
From box is empty in which case SafeItem.Sender.Name ceases to exist at all
and SafeItem.Sender becomes Nothing - rather than a Null or an empty string
which could be more easily tested for.
Any ideas gratefully received...
I'd post it here. Is there any way of testing for an empty property, i.e.
one that's been set to Nothing? I've tried all the functions like IsEmpty,
IsNull, IsMissing, etc but I've ended up having to settle for a rather clumsy
error routine that catches error 91.
The particular case in which I'm having problems is using Redemption: in the
CurrentItem_PropertyChange event (for ThisOutlookSession module) I've set the
SafeItem equal to the CurrentItem but for some reason the SentOnBehalfOfName
doesn't come across, even though I've preceded this line with a
CurrentItem.Save (the strange thing about this is that it worked fine when
run in the CurrentItem_Send event - I guess it's something to do with trying
to save an entire message before one of its properties has been updated). As
a work around, I'm using SafeItem.Sender.Name (a property I spotted in the
Locals window while stepping through the code). This works fine unless the
From box is empty in which case SafeItem.Sender.Name ceases to exist at all
and SafeItem.Sender becomes Nothing - rather than a Null or an empty string
which could be more easily tested for.
Any ideas gratefully received...