Issues with Hyperlink

Hi

I need to have some text in the format:
Email: [email protected]

Email -> simple text
[email protected] -> a hyper ink, clicking on the same would open a new mail message.

I am using the following piece of code.
IWParagraph para = footerTbl[0, 0].AddParagraph();
para.AppendText("Email: " + emailAddr).CharacterFormat.FontSize = 7;
IWField email = para.AppendField(emailAddr, FieldType.FieldHyperlink);
email.CharacterFormat.FontSize = 7;
Hyperlink emailLink = new Hyperlink(email as WField);
emailLink.Type = HyperlinkType.EMailLink;
emailLink.Uri = "mailto:" + emailAddr;

When i open the document, it throws an error when for styles, but clickeing on recover doc does have the required email in the document.

Another thing is - the same code creates a doc without any errors in a Windows App but not when it's a class library.

Can you please help.

Thanks
-Namita


1 Reply

PR Poornima R Syncfusion Team June 16, 2011 01:53 PM UTC

Hi Namita,

Thank you for your interest in Syncfusion Products.

We have created a simple sample for “Inserting Hyperlink to the word document”. Please find the sample from the below link. Try running the sample and let us know if this helps you.


Sample:
Hyperlink-472650062.zip


Please let us know if you have any questions.

Regards,
Poornima



Loader.
Up arrow icon