View Single Post
  #1  
Old January 9th 06, 01:26 PM posted to microsoft.public.outlook.program_vba
Martin
external usenet poster
 
Posts: 87
Default test for new message

thanks Eric - just what I needed.

"Eric Legault [MVP - Outlook]" wrote:

Try the Sent property; it will be False for new messages, True for old ones.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Martin" wrote:

I'm using the NewInspector event in the ThisOutlookSession module to
customise how users are greeted when they create a new message. I'm using:
If TypeOf Inspector.CurrentItem Is Outlook.MailItem
to make sure this code only runs for a message (and not a contact or
anything else that's being created!).

That's fine - however, I also need a test to stop the code running if the
user opens up an old message. Does anyone know a neat way of doing this?
The only thoughts I've had are the messages Saved property (which doesn't
work because it shows as True even for a new message) and testing that the
Inspector's Caption starts with "Untitled" (which of course includes old
messages without a subject).

Thanks

Ads