views:

475

answers:

2

I need to develop the Outlook Extension capable of extending existing forms with tabs, downloaded from remote server. For example, in the appointment form additional tab should appear. Form definition in this tab is downloaded from a web service and rendered using, say, WPF. Data for this tab is also coming from server, and is bind to the form fields. Final thing - when form is saved, it should be also submitted to this remote server.

It should work in Outlook 2003 and 2007.

Main questions are:

  1. Is it at all possible?
  2. What to read to grasp it faster? MSDN is big, even its Outlook developer section.
  3. Are there any samples?

UPDATE

Many thanks for answers! Definitely, there are too many different questions, so I'll have to break it down into several parts. After reading responses and making my homework I want to resume:

  1. Yes, it's possible. Maybe I'll found some underwater rocks later, though.
  2. Best way is to take VS 2008 and try to make extension.
+3  A: 

Ok there are many questions inside your post, I think I have some of the answers, but not all. Anyway, there is too much things in your question for a single post to cover it all.

First thing to know is that Outlook 2007 has a different way to do things than the previous versions. So you will probably have to do things twice in order to use both Outlook 2003 and 2007.

First thing to know is the vocabulary that will help to search what you need. In Outlook 2003, you will use Custom Forms to create or extend forms. In Outlook 2007, you will use the new Form Regions. Although they are similar in concept, they are 2 different things.

Since I've worked only in Outlook 2007, what I say next only apply to that. You will need to have either Visual Studio 2005 and download VSTO (Visual Studio Tools for Office), or Visual Studio 2008.

A form region has one of 4 types : Adjacent, Separate, Replace or Replace-All. Adjacent means its displayed at the bottom of the default form. Separate means it is a new "page" inside the form. Replace means it replaces the first page of the default form, and Replace all means it replaces all the page of the default form.

You said you wanna use Tabs. In Outlook 2007, you shouldn't. You should use separate pages, to respect the UI principles in Outlook 2007. You may create Tabs, but you will see they will appear quite ugly. On the other hand, Separate pages appear in the Ribbon, which allows you to switch easily from one page to another.

You have two ways to design Form Regions. The first, recommended way, is the designer inside Outlook 2007 : something like "Tools > Forms > Create a Region Form". You design inside this thing, save the form as a .ofs file and then import it into Visual Studio.

Advantages :

  • Recommended by Microsoft, so almost all the resources about customising Outlook 2007 uses this method.
  • Ready-made controls for Outlook (for example fields designed to hold mail addresses).
  • Automatic bind to UserProperty in your mail.

Drawbacks :

  • Crude designer (it's hard to get things aligned properly).
  • Whenever you want to update your form, you will have to modify it in Outlook, and upload it again in Visual Studio, which will erase your previous code.
  • Old COM controls which are awful to work with.

The other way, is to design a new Region Form in Visual Studio.

Advantages :

  • You have all the latest, powerfuls, winforms control you want.
  • Better designer.
  • Easy to update.

Drawbacks :

  • You won't find much information about it, since most book authors only use the Outlook designer.
  • You will have to code by yourself many behaviors you take for granted in Outlook (such as, creating a textbox which can hold and check multiple mail addresses) which is quite painful and may be hard to do.

I think you can send your custom forms (at least those designed in Outlook) with a mail, but I'm not sure since I've never tried it myself.

As for the binding, you will probably be able to do this with event. For example, there are events that are triggered before saving or sending a message.

That's all for now, I hope i'm not off-topic with my long answer, and that it can help you determine exactly what you want to do. You should get some idea of what Outlook allows you to do and then ask more specific questions on each point.

Ksempac
Great explanation! Thank you.
XOR
FYI : I'm currently working on 2 Outlook 2007 add-ins with lot of region forms. One use the Outlook designer, the other one use design in VS2008 (different requirement, different timeline). I can tell you we stumbled on hidden stones and pits almost every week. So brace yourself, you're in for a rough ride.
Ksempac
+1  A: 

This is not possible as you describe but you can get some of the way there. Also Ksempac has pointed out alot of good stuff on the pros and cons on how to do things in outlook 2007.

To get this up and running in 2003 and 2007 I think that the best way to go would be to design your own appointment form. You can extend one of the tabs to have a browser control that displayed the dynamic form from your Web service. The results of which could be submitted back or saved with the new outlook form for rendering/processing later.

examples :

Form Design Example: http://www.msexchange.org/articles/Designing-Outlook-Forms-Part1.html

Overwrite a default forms: http://support.microsoft.com/?kbid=241235

There is a load of good stuff on the here and the net about designing outlook forms and you can all ways ask on here. There are a couple of good books as well on forms:

Sue Mosher's books and site are a good place to start. Outlookcode.com

Microsoft Outlook Programming: Jumpstart for Administrators, Developers, and Power Users (ISBN 1-555-58286-9, Digital Press)

Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators (ISBN 1-55558-346-6, Digital Press)

As Ksempac you probally need to break you question down and ask as you go ..

update If you have some budget Add-in Express http://www.add-in-express.com/ will take the pain out of deploying to the 2 versions outlook and you may get you productive quicker than if you do it by hand.

76mel