richtextbox in form region

D

Dinesh

hello everbody,

iam using visual c# 2008 with outlook 2007. i created a form region to
show the a hyperlink from the inbox email internet header. From the outlook i
cant open the weblink in internet explorer. my code is

private void FormRegion1_FormRegionShowing(object sender, System.EventArgs e)
{
richTextBox1.Text =
GetTransportHeaders((Outlook.MailItem)this.OutlookItem);
richTextBox1.DetectUrls = true;


}
//private void richTextBox1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
// {
// RtbContextMenu1.Display(RichTextBox1, e);
// }


public static string GetTransportHeaders(Outlook.MailItem mail)
{
const string PR_TRANSPORT_MESSAGE_HEADERS =
"http://schemas.microsoft.com/mapi/proptag/0x007D001E";

try
{
string internetHeaders =
(string)mail.PropertyAccessor.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS);
int che = internetHeaders.IndexOf("X-context-id");
int ch = internetHeaders.IndexOf("X-Virus");
string str = internetHeaders.Substring(che,ch-che);
return str;

}
catch
{
string str1 = "No Header info";
return str1;
}
}

For example i will be getting http://www.microsoft.com in my richtextbox.i
need open this in IE when i click the link.

Thank you.
 

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