message header in outlook 2003 shared add-in

J

Jinghui

Hi, I am developing an outlook 2003 shared add-in by using VS.net 2005 in C#.
I need to check the message header and modify it. Can you show me how to do
it? Thanks
 
K

Ken Slovak - [MVP - Outlook]

Do you mean the Internet mail headers? Those would only be available in
received emails that came over the Internet, not internal Exchange emails.

There is no way to access that information using only the Outlook object
model in Outlook 2003. The property you need (PR_TRANSPORT_MESSAGE_HEADERS)
isn't available. You would have to use a different API such as Extended MAPI
(C++ or Delphi only, not supported in managed code) or CDO 1.21 (not
supported in managed code) or a 3rd party library such as Redemption
(www.dimastr.com/redemption).
 
J

Jinghui

Thanks Ken for your reply.

For internal Exchange mails, can I write to the internet mail headers by
using redemption (in the ItemSend event handler) and then read the headers
when the mail item is replied/forwarded?

I have been researching how to use Redemption in my outlook add-in. I know
there are examples in www.dimastr.com/redemption but as a newbie, I don't
really know how to plug the sample code into my shared add-in. Are there any
shared add-in examples that use redemption to read/write internet mail
headers?
 
K

Ken Slovak - [MVP - Outlook]

With internal Exchange emails there are no Internet email headers at all, so
you can't read or write what doesn't exist.

If you use the method shown in the Redemption samples that will create a
named MAPI property which will be preserved in the sent email when it's an
internal Exchange email and will be converted into an X-header if the email
is sent out of the Exchange organization. For internal emails you just
read/write the named MAPI property.

I'm not aware of any sample COM addins that show using Redemption. You can
just set a reference to the Redemption DLL and use it in your COM addin
project. Just remember that the sample code is written in VBScript so there
are no declarations of strongly typed items and in some cases the code
samples don't declare even late-bound variables and relies on implicit
object creation.
 
J

Jinghui

Thank Ken for your reply.

Just wondering will the shared add-in developed for outlook client be
working in OWA environment?
 
K

Ken Slovak - [MVP - Outlook]

No. OWA is a completely different animal. It's not a COM application, it
doesn't run on the client at all. It runs on the server as a javascript
application. To customize OWA you have to rewrite the original OWA source to
your specifications and use that instead of the original OWA code and do
your changes over again each time there's an update or service pack or new
version of Exchange.
 
J

Jinghui

Thanks Ken for your reply.

In stead of rewrite the origianl OWA source everytime, would it be possible
if we wrap the add-in as a web service, and call the web service from the
javascript on the server?

Are there any good links show how to customize OWA please?
 
K

Ken Slovak - [MVP - Outlook]

It's possible but I'm no expert on the workings of OWA or how to customize
it. You're probably best off asking about this in an Exchange development
forum such as microsoft.public.exchange.development.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top