Displaying custom fields

M

mattdeubert

I have created an add-in in vs2005 c# which is adding custom
properties to mails, and I wish to display these custom properties in
the folder view.

I have found various postings detailing cfg files to allow display of
extended mapi properties such as the sender email address, but i'm not
sure how to modify these cfg files to allow me to display the custom
fields I have created.

Can anyone explain to me how to do this, or more simply what the
various sections in the cfg file refer to so that I can create my own?
I can't find any detail about creating these files, just prepared
examples for specific extended mapi properties.

Alternatively, i'd be happy with displaying the custom fields on a
custom form displayed instead of the ipm.note standard form.

Any help would be appreciated.
 
S

Sue Mosher [MVP-Outlook]

You don't need a .cfg file to display a property you've added through
MailItem.UserProperties.Add. The third parameter for that property needs to
be True, in order to add it to the properties defined at the folder level.
Once you've done that, you can display the property by modifying the value of
View.XML in Outlook 2003 or, in Outlook 2007, using the TableView.ViewFields
collection. For best results, your application should create and apply its
own new view, rather than modifying the currently displayed view.

If you're targeting Outlook 2007, you can display the custom fields in a
form region.

TIP: Always specify the Outlook version(s) you're targeting when you post,
as there are significant differences between them.
 
M

mattdeubert

Thanks Sue. It is OL2007 i'm targetting, and i'm well on my way now.
I'm creating the folder in question at run time, so all I have to do
now is set the view after creating the folder and i'm there.

Much appreciated!
 
M

mattdeubert

Thanks Sue. It is OL2007 i'm targetting, and i'm well on my way now.
I'm creating the folder in question at run time, so all I have to do
now is set the view after creating the folder and i'm there.

Much appreciated!
 
D

Doobs

I now have this working fine, using a combination of Redemption and
the Outlook Object Model. Myissue now is that when I open a message, I
would like the additional fields to be displayed in the form.

Is there a way to amend the form in code, rather than creating and
deploying a custom form and associating it with the custom message
class? There seems to be a vast amount of info out there on custom
forms, but i'm having trouble finding examples of exactly what I want
to do.
 
D

Doobs

Thanks Sue. I'm using a form region now, as described in the
walkthrough, and i have the "Hello World" type example working fine.

What I can't manage to work out is how to modify the controls on the
form region from within my main addin code. I'm working in c# by the
way.

All I want to do is change the caption of a label field or the text of
a textbox, but I don't seem to be able to reference these controls
from my addin code. I must be missing something in the examples.
 
S

Sue Mosher [MVP-Outlook]

What event are you using? In other words, when are you trying to modify those
control properties?

Also, for a bound control, you should change the underlying Outlook property
value, not the control value.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
D

Doobs

I'm trying to edit the controls on form load, i've set the custom
properties on the mails as i've created them in the fodler, and I
simply want to display them when the user opens the mail.

I'll have a look at the underlying property, as you suggest. Thanks.
 

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