To know new message length

Status
Not open for further replies.
T

TmFnYXJhag

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
 
K

Ken Slovak - [MVP - Outlook]

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.

"Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message

news:E9E7BAAA-0A02-496D-8EE0-04F69DF0733C@microsoft.com...
> 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
 
T

TmFnYXJhag

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
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.

> >

>

> "Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message
> news:E9E7BAAA-0A02-496D-8EE0-04F69DF0733C@microsoft.com...
> > 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


>
 
K

Ken Slovak - [MVP - Outlook]

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,

"Nagaraj" <nagaraj.tadipatri@gmail.com> wrote in message

news:B7D3B7A5-9509-4017-9BCD-0E9DB56702CE@microsoft.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A rule name into message - how? Outlook VBA and Custom Forms 5
A Links in email getting error message about group policy Using Outlook 4
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
Commodore Unable to move message Using Outlook 3
Y Disable Microsoft Outlook Test Message Using Outlook 5
S Unable to change Message Class Outlook VBA and Custom Forms 0
S Changing Message Class Outlook VBA and Custom Forms 4
Cathy Rhone Mail merge error message Using Outlook 2
C Can't Locate an Unread Message in my Outlook view pane Using Outlook 0
G Send a greeting message to a contact on birthday Outlook VBA and Custom Forms 5
B Inconsistent handling of message read/unread status by Outlook Using Outlook 3
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
O Outlook 2010 Add delete button to the side of the message list Using Outlook 1
Cathy Rhone The properties of the message have been changed Using Outlook 1
S Outlook 2016 A Shortcut to recall and delete and sent message. Using Outlook 1
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
S Unable to extract text from an Outlook email message Using Outlook 2
R Outlook 2016 Message-ID oddity/inconsistency? Using Outlook 7
J Implement Keywords based on body message Outlook VBA and Custom Forms 0
C must select message to trigger safe list Using Outlook 3
witzker HowTo Change message Class of contact form Outlook VBA and Custom Forms 0
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
A Flag Message for Follow Up after sending Outlook VBA and Custom Forms 1
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
C Why won't Title display in message list? Using Outlook 1
icacream content in this message could not be downloaded.... Using Outlook 2
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
R Warn before sending message Outlook VBA and Custom Forms 4
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
V Change start time based on message duration Outlook VBA and Custom Forms 2
J Message search and edit, another way? Outlook VBA and Custom Forms 4
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
M VBA to auto forward message with new subject and body text Outlook VBA and Custom Forms 8
T Missing text in e-mail message after "(Please keep confidential)" Using Outlook 3
C Custom Form (seperate layout pages and message reading pane) Outlook VBA and Custom Forms 0
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
M Message list font changed after update Using Outlook 2
BretAB Is it possible to add a lookup field to a Message form? Outlook VBA and Custom Forms 4
D Unopened message in inbox deleted and not in deleted items Using Outlook 3
T Change the selected Message in the Outlook window Outlook VBA and Custom Forms 2
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
W Message class changes of a custom form changes to the default form Using Outlook 2
evdbogaard Reply with only last message cited Using Outlook 1
T O365 and Office Message Encryption Exchange Server Administration 2
S Custom Form, copy user field data to message body Outlook VBA and Custom Forms 12

Similar threads

Top