Thank you for this code - it look likes what I want, but when I tried it I get a compilation error.

I have referenced to Microsoft Outlook 14.0 Object Library and Microsoft CDO for Windows 2000 Library (the only Microsoft CDO in the list, location C:\Windows\SysWOW64\cdosys.dll).

When I try to run the code, it goes to the top line of the function and gives the message "Compile Error: User-defined type not defined". Any ideas?

It does not seem to like the following types: CdoPropTags, Fields, Field or Session