A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

To know new message length



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 9th 09, 02:47 PM posted to microsoft.public.outlook.program_addins
Nagaraj
external usenet poster
 
Posts: 22
Default To know new message length

Hi,

I opened already existing mail.I clicked Forward button. I entered some
valid email address in To field. Without entering anything I clicked Send
button.

My requirement is how to know that I didn't enter anything.
i.e I want to know the length of newly entered text which is 0.

How to calculate this value?

Thanks


--
Nagaraj Tadipatri
Ads
  #2  
Old April 9th 09, 03:26 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default To know new message length

Get the length of the Body and/or HTMLBody properties when the item opens,
get it again when the Send() event fires. Compare the 2 values.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Nagaraj" wrote in message
...
Hi,

I opened already existing mail.I clicked Forward button. I entered some
valid email address in To field. Without entering anything I clicked Send
button.

My requirement is how to know that I didn't enter anything.
i.e I want to know the length of newly entered text which is 0.

How to calculate this value?

Thanks


--
Nagaraj Tadipatri


  #3  
Old April 9th 09, 04:09 PM posted to microsoft.public.outlook.program_addins
Nagaraj
external usenet poster
 
Posts: 22
Default To know new message length

Thank you Ken for your reply.

My requirement is when I open an existing mail item and click Forward
button, it will automatically add 2 blank lines. So when I calculate the
difference between those two values it is even counting blank characters also.

I declared one variable originalMessage and assigned it a value in the
mail_Forward event as follows


originalMessage = forwardMail.HTMLBody;

In the Item_Send event I am calculating legth as follows

length = mailItem.HTMLBody.Trim()Length - originalMessage.Trim().Length



where length is coming as 1537

I want to validate new message length to be 0 since I didn't enter any new
characters. How to do this in c#

Thanks
--
Nagaraj Tadipatri


"Ken Slovak - [MVP - Outlook]" wrote:

Get the length of the Body and/or HTMLBody properties when the item opens,
get it again when the Send() event fires. Compare the 2 values.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Nagaraj" wrote in message
...
Hi,

I opened already existing mail.I clicked Forward button. I entered some
valid email address in To field. Without entering anything I clicked Send
button.

My requirement is how to know that I didn't enter anything.
i.e I want to know the length of newly entered text which is 0.

How to calculate this value?

Thanks


--
Nagaraj Tadipatri



  #4  
Old April 9th 09, 07:46 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default To know new message length

I don't understand your issue. Add the 2 lines, then calculate the length,
then do what you're doing in Send() and get the difference. The code you
show should work,

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Nagaraj" wrote in message
...
Thank you Ken for your reply.

My requirement is when I open an existing mail item and click Forward
button, it will automatically add 2 blank lines. So when I calculate the
difference between those two values it is even counting blank characters
also.

I declared one variable originalMessage and assigned it a value in the
mail_Forward event as follows


originalMessage = forwardMail.HTMLBody;

In the Item_Send event I am calculating legth as follows

length = mailItem.HTMLBody.Trim()Length - originalMessage.Trim().Length



where length is coming as 1537

I want to validate new message length to be 0 since I didn't enter any new
characters. How to do this in c#

Thanks
--
Nagaraj Tadipatri


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
default meeting length lynseyk Outlook - Calandaring 7 January 15th 10 10:05 PM
Message length shakey Outlook Express 4 April 28th 08 12:42 AM
Display appointment length jag Outlook - Calandaring 0 December 6th 06 06:31 PM
How to show the length of duration for an ? John Outlook - Calandaring 5 June 13th 06 05:09 AM
How to validate character length Bruce Manley Outlook - Using Forms 1 May 16th 06 04:53 PM


All times are GMT +1. The time now is 07:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.