forward event in outlook with c#

Status
Not open for further replies.
T

TmFnYXJhag

Hi All,

I have some text (original message) as follows

<i>please see below. i will send another one where its coming on top of the

email</i
I am capturing this text in the mail_forward event in a string

I added some more text (<b>current text</b> which is combination of original

message and some more new text)

In the Item_Send event I want to know the index of original message in the

current text.

The problem is when I print current text it is as follows

<div
<p class=MsoNormal>please see below. i will send another one where its

coming on top of the email<o:p></o:p></p
</div
from where these extra lines and <p> tags <o:p> tags are coming? for this

reason

I am unable to find original message in the current text. i.e. I want to

find the index of original message in the new text. Can anyone tell me how to

do this in c#

Thanks

Nagaraj Tadipatri
 
K

Ken Slovak - [MVP - Outlook]

Outlook will rewrite your HTML so you can't depend on it remaining exactly

as you set it. We went through this before if I'm not mistaken. You just

look for your string as a substring of the HTMLBody property to get where it

starts. If you want the index of where a <div> tag starts then get your text

index and work backwards from there.

There are a limited number of ways that Outlook will rewrite your text,

depending on Outlook version and whether or not WordMail is enabled. Those

are all properties you can check at runtime. If you get the pattern of how

the HTML is rewritten on each permutation of Outlook/WordMail you intend to

support you can use that information to know what to look for in that

specific case.

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

news:86CAE2C1-DFD9-483C-AC02-CB0D93C54C76@microsoft.com...
> Hi All,

> I have some text (original message) as follows

> <i>please see below. i will send another one where its coming on top of
> the
> email</i
> I am capturing this text in the mail_forward event in a string

> I added some more text (<b>current text</b> which is combination of
> original
> message and some more new text)

> In the Item_Send event I want to know the index of original message in the
> current text.

> The problem is when I print current text it is as follows

> <div
> <p class=MsoNormal>please see below. i will send another one where its
> coming on top of the email<o:p></o:p></p
> </div

> from where these extra lines and <p> tags <o:p> tags are coming? for this
> reason
> I am unable to find original message in the current text. i.e. I want to
> find the index of original message in the new text. Can anyone tell me how
> to
> do this in c#

> Thanks

> > Nagaraj Tadipatri
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
G Capture "forward event" ? Outlook VBA and Custom Forms 11
J Capturing forward event when multiple items are selected Using Outlook 0
C Persist all recipients on Item forward event Outlook VBA and Custom Forms 5
M In Outlook Calendar remove the buttons: 'Today' and '<' (Back a day) and '>' (Forward a day) that are below the Ribbon and above the calendar display. Using Outlook 0
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
C How to rename subject line and forward the email Outlook VBA and Custom Forms 2
R Error when trying to forward current email item Outlook VBA and Custom Forms 7
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
G Missing forward/replied icons Using Outlook 2
M VBA to auto forward message with new subject and body text Outlook VBA and Custom Forms 8
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
B Forward every other email in Outlook 2013 Outlook VBA and Custom Forms 2
D Disable or hide "reply" and "reply to all" and "forward" in email from access vba Outlook VBA and Custom Forms 1
Sabastian Samuel HOW DO I FORWARD AN EMAIL WITH MACRO using an email that in the body of another email Outlook VBA and Custom Forms 3
C Don't forward duplicate Using Outlook 0
undercover_smother Automatically Forward All Sent Mail and Delete After Send Outlook VBA and Custom Forms 10
A Forward Outlook Email by Filtering using Macro Rule Outlook VBA and Custom Forms 44
I change subject and forward without FW: Outlook VBA and Custom Forms 4
C VBA to Forward e-mails from certain address and between certain times Outlook VBA and Custom Forms 1
J Forward Action in Form Outlook VBA and Custom Forms 1
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3
K add pdf to every reply or forward Outlook VBA and Custom Forms 1
Brostin Forward a mail to the address listed in the email text Outlook VBA and Custom Forms 1
N Going Forward: Using Outlook 2016 for RSS Feeds Using Outlook 2
J Forward Message after editing attachments and include edited attachments Using Outlook 5
R changing FW: on forward Outlook VBA and Custom Forms 3
Z Auto Forward Using Outlook 4
N Outlook script to forward emails based on senders' address Outlook VBA and Custom Forms 2
S Merge Emails with attachments with inbox rule to forward Using Outlook 5
B Auto Save of Attachments from Multiple Emails and forward attachments to user group Outlook VBA and Custom Forms 1
A Creating an outlook rule to forward an email with a specific message Using Outlook 1
D Forward message to address from subject Outlook VBA and Custom Forms 1
D How to forward each email x minutes after it arrives in inbox and hasn't been moved or deleted? Using Outlook 1
W Macro to forward email Outlook VBA and Custom Forms 2
J How to change From then forward message Outlook VBA and Custom Forms 1
S Reply & Forward Date in original message incorrect Using Outlook 2
Diane Poremsky Forward Messages that were not Replied To New Slipstick.com Articles 0
mikecox Forward email to another address; not with Rules Using Outlook 3
divan Macro to format email in a certain folder then forward to email address Using Outlook 3
D forward email with attachment using .oft Using Outlook 3
J Outlook 2010: can't forward appointment on custom form Using Outlook 1
J Forward a bounce mail? Using Outlook 1
P How to save sent mail and forward it the next day Exchange Server Administration 3
T outlook 2013 does not mark multiple forward messages as forward Using Outlook 2
D Forward Only an Attachment Using Outlook 1
R Auto-create receipt from email and forward to payer Using Outlook 3
L Auto Forward without presenting the original sender Outlook VBA and Custom Forms 1
C Unable to forward email with URL Using Outlook 2
Similar threads


















































Top