Some basic Outlook principles and thoughts on how they might affect your
project:
1) You cannot set a message form as the default form for a folder. It would
be meaningless, since messages are designed to be sent, not saved.
2) Changing the default form for a folder has no effect on existing items.
(Remember that Outlook is a semi-structured database and allows
heterogeneous items in a single folder.)
3) You can make a registry change to substitute your custom form for the
default form. See
http://www.outlookcode.com/d/newdefa...#changedefault . However, it
doesn't work completely for message forms in Outlook 2003 and so this method
would probably not be suitable.
4) To change the form used for an individual item, you need to change the
MessageClass of that item. This can be tricky when you're doing it on the
fly. In your case, you could use the NewInspector event to detect the item
opening, change the MessageClass, save the item, get its EntryID, and then
close the Inspector and dereference all objects. Then use
Namespace.GetItemFromID to open the item, hopefully displaying the custom
form. Because of Outlook's caching and .NET's garbage collection, I'm not
sure it will work, though.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"sublimese" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am writing an Addin for Outlook 2003 using C#. I am wondering if
> anyone can answer a question or point me in the proper direction.
>
> When my addin loads in Outlook, I want custom Outlook forms to be used
> instead of the default Outlook forms. For example, when someone goes
> to their inbox and opens an email (or presses the "New" button to make
> an new email), when my addin is loaded, I want Outlook to load
> "IPM.Email.MyCustomEmail", when/if my addin is not loaded, I would want
> Outlook to load its default form. Is there a way to do this? I have
> looked into trying to iterate the folders collection and setting the
> default message type (which does not work because that property is read
> only). The ideal solution would be to hook the form opening event in
> my addin and have it open my custom form and cancel the opening of the
> default form. If the ideal solution is not possible, dynamically
> setting the MessageType on each folder would work as well.
> Thank you very much,
> Kelly Johnson
>