Length of an Outlook MailItem Body field

I

István Becze

I'm trying to implement a body length counter for and Outlook MailItem. I'm
using a custom form to present the MailItem, but on the custom form the Body
field is the standard Outlook field. (I'm not interested in HTML tags, I just
want to know how many characters the message body has.)

The first problem is that I don't have access to the control on the window
(probably because of the formating options, i.e. Text, RFT or HTML).

Therefore, I'm forced to use the data field behind the UI (i.e. Body field).
However, it seems that Outlook randomly appends something that seems like a
buffer to the text that is visible on the UI, and there is a lapse (which can
be 3-4 seconds) before the garbage at the end of the Body field is actually
truncated. This behavior causes my counter fluctuate, before it settles to
the correct number.

This problem seems to be happening more in Outlook 2007 then in 2003.

If anybody has a better way to get the Body length, I would appreciate the
help.

Thank you,

Istvan Becze
 
K

Ken Slovak - [MVP - Outlook]

I just read item.Body and haven't seen the problem you're having. Try this
again with a more standard form and see if it persists. It sounds like
something the custom form is doing.
 
I

István Becze

Thank you for checking Ken.

I think I wasn't clear on one thing. I'm having the problem while the user
is typing into the message body. Once the typing stops, the counter settles,
within 4 seconds. (Sometimes faster). As I wrote, it is not so annoying in
Outlook 2003 but it is in 2007.

But, I'll try with a standard MailItem form and post the result.

Thank you for your help,

Istvan
 
I

István Becze

Ken, I checked with the standard MailItem form and it behaves the same way.
(I.e. the body length fluctuates.)

Thanks,

Istvan
 
K

Ken Slovak - [MVP - Outlook]

Then it's a matter of the reaction to the user typing. I've heard of some
people who seem to have problems with their keystrokes not showing up for a
while and then suddenly appearing when typing in an item, others don't have
that problem. It seems to vary and so far no one has come up with one or
more universal causes.

I think until the perf issues with Outlook 2007 are settled by MS you'll
just have to live with your counter jumping. I'll do some testing here on a
couple of Outlook 2007 setups when I get a chance. Are you testing this on
WinXP or Vista or both?
 
I

István Becze

I'm using winXP for both Outlook 2003 and 2007 development (and testing).

You are right, I'll probably just have to wait till the first SP comes out.

Thanks again for checking and if I come across some information on this
issue, I'll tet you know.

Istvan
 

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