We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

href and mailto

Hi, I''m evaluating DocIO and have not found reference on how to insert a mailto: and a URL into a Word document. Maybe I have just overlooked this functionality. Is it possible to insert these dynamically into a DocIO document so that Word displays them as links.

Thanks

8 Replies

AD Administrator Syncfusion Team August 21, 2006 09:42 PM UTC

Hi Keith,

Thank you for evaluating Essential DocIO.

Currently we do not have support to insert hyperlinks to the document. I have added this as a feature request with our development team. You can track the live status of this feature here,

Feature Request #1170 - Add an ability to insert hyperlinks to the document.

However we have a support to preserve the hyperlinks from an excising template document. I have attached the sample for your reference. Please take a look at the sample and let me know if you have questions.

Thanks,
Prabhu.



>Hi, I''m evaluating DocIO and have not found reference on how to insert a mailto: and a URL into a Word document. Maybe I have just overlooked this functionality. Is it possible to insert these dynamically into a DocIO document so that Word displays them as links.

Thanks


Hyperlink_Preserve.zip


AD Administrator Syncfusion Team August 23, 2006 05:42 AM UTC



>Hi Keith,

Thank you for evaluating Essential DocIO.

Currently we do not have support to insert hyperlinks to the document. I have added this as a feature request with our development team. You can track the live status of this feature here,

Feature Request #1170 - Add an ability to insert hyperlinks to the document.

However we have a support to preserve the hyperlinks from an excising template document. I have attached the sample for your reference. Please take a look at the sample and let me know if you have questions.

Thanks,
Prabhu.



>Hi, I''m evaluating DocIO and have not found reference on how to insert a mailto: and a URL into a Word document. Maybe I have just overlooked this functionality. Is it possible to insert these dynamically into a DocIO document so that Word displays them as links.

Thanks


Hyperlink_Preserve.zip


BD Benoit Drapeau March 19, 2008 03:37 PM UTC

Hi, can you please tell me the status of this incident? Is it implemented in the version 6.1.0.* and if so, how do we use it? I found a way to create field of type hyperlink and they do seem to behave has hyperlink when the word document is opened but I did not found any way to change the uri. Also, when adding a hyperlink field type, the look and field is not the same as if I was adding an hyperlink from within Word.

thanks in advance

Benoit

>Hi Keith,

Thank you for evaluating Essential DocIO.

Currently we do not have support to insert hyperlinks to the document. I have added this as a feature request with our development team. You can track the live status of this feature here,

Feature Request #1170 - Add an ability to insert hyperlinks to the document.

However we have a support to preserve the hyperlinks from an excising template document. I have attached the sample for your reference. Please take a look at the sample and let me know if you have questions.

Thanks,
Prabhu.



>Hi, I'm evaluating DocIO and have not found reference on how to insert a mailto: and a URL into a Word document. Maybe I have just overlooked this functionality. Is it possible to insert these dynamically into a DocIO document so that Word displays them as links.

Thanks


Hyperlink_Preserve.zip




AD Administrator Syncfusion Team March 20, 2008 11:28 AM UTC

Hi Benoit,

Thanks for the update.

We do have support for inserting the Hyperlink field into the document by using the AppendField() method in version 6.1.0.34. It act as Hyperlink but it will not look like hyperlink. For this we need to format the paragraph manually. Please refer the below code snippet for inserting the Hyperlink field and Formatting the field.
[C#]
//Create style for hyperlink formatting
IWParagraphStyle style = (IWParagraphStyle)document.AddParagraphStyle("UserStyle_Heading1");
style.CharacterFormat.UnderlineStyle = UnderlineStyle.Single;
style.CharacterFormat.TextColor = Color.Blue;
par.ApplyStyle(style.Name);

//Insert hyperlink
par.AppendField("http://www.syncfusion.com", Syncfusion.DocIO.FieldType.FieldHyperlink);
par.AppendText("");
par.AppendField("http://www.google.com", Syncfusion.DocIO.FieldType.FieldHyperlink);

Please download the sample from the below location:


http://websamples.syncfusion.com/samples/DocIO.Windows/F48167_1/main.htm


Please let me know if you have any questions.

Best Regards,
Bhuvana






BD Benoit Drapeau March 20, 2008 11:54 PM UTC

Thanks for the fast answer. I did what you said and it work perfectly except for one thing. I need to be able to change the text that will be displayed for my hyperlinks because all of my hyperlinks will have the same text but they will refer to different bookmarks in other Word files. Is this possible? Let me clarify my needs:

I have 4 word files (please forgive my english):

Capacities
Capacities description 1
Capacities description 2
Capacities description 3
Capacities description 4

From the Capacities Word document, I will have a couple of hyperlinks, having all the same text (i.e. "File"), that will refer to different locations (bookmarks) in the other Word files (Capacities description 1, 2, 3, 4, etc...)

Thanks again for your help and if I may say, your components are WONDERFUL (currently using XlsIO and DocIO). The learning curve is very easy and I was able to reproduce an existing document with an accuracy of almost 99%. Your components rocks!

Benoit Drapeau

>Hi Benoit,

Thanks for the update.

We do have support for inserting the Hyperlink field into the document by using the AppendField() method in version 6.1.0.34. It act as Hyperlink but it will not look like hyperlink. For this we need to format the paragraph manually. Please refer the below code snippet for inserting the Hyperlink field and Formatting the field.
[C#]
//Create style for hyperlink formatting
IWParagraphStyle style = (IWParagraphStyle)document.AddParagraphStyle("UserStyle_Heading1");
style.CharacterFormat.UnderlineStyle = UnderlineStyle.Single;
style.CharacterFormat.TextColor = Color.Blue;
par.ApplyStyle(style.Name);

//Insert hyperlink
par.AppendField("http://www.syncfusion.com", Syncfusion.DocIO.FieldType.FieldHyperlink);
par.AppendText("");
par.AppendField("http://www.google.com", Syncfusion.DocIO.FieldType.FieldHyperlink);

Please download the sample from the below location:


http://websamples.syncfusion.com/samples/DocIO.Windows/F48167_1/main.htm


Please let me know if you have any questions.

Best Regards,
Bhuvana








AD Administrator Syncfusion Team March 27, 2008 09:41 AM UTC

Hi Benoit,

Thanks for the update and thanks for your feedback about our product.

To edit the hyperlink

Currently we don't have direct support for editing the existing document Hyperlink Text. But we can workaround this by removing the hyperlink and adding the new Hyperlink. We can check the paragraph field types by using par.ChildEntities.FirstItem is WField. Please refer the below code snippet to edit the Hyperlink Text

[C#]
foreach (IWParagraph par in sec.Paragraphs)
{
if (par.ChildEntities.FirstItem is WField)
{
WField fi = par.ChildEntities.FirstItem as WField;
if (fi.FieldType == Syncfusion.DocIO.FieldType.FieldHyperlink)
{
//Create style for hyperlink formatting
IWParagraphStyle style = (IWParagraphStyle)document.AddParagraphStyle("UserStyle_Heading1");
style.CharacterFormat.UnderlineStyle = UnderlineStyle.Single;
style.CharacterFormat.TextColor = Color.Blue;

//Create new paragraph
IWParagraph p1=document.CreateParagraph();
p1.ApplyStyle(style.Name);
p1.AppendField("www.yahoo.com", FieldType.FieldHyperlink);
//Change the hyperlink format
sec.Paragraphs.RemoveAt(i);
sec.Paragraphs.Insert(i,p1);


}
}
i++;
}
Here is the sample for your reference:

http://websamples.syncfusion.com/samples/DocIO.Windows/F48167_2/main.htm


Please let me know if this helps you.

Best Regards,
Bhuvana




GF Gustavo Friedrich replied to Benoit Drapeau February 25, 2018 01:00 AM UTC

Hi, can you please tell me the status of this incident? Is it implemented in the version 6.1.0.* and if so, how do we use it? I found a way to create field of type hyperlink and they do seem to behave has hyperlink when the word document is opened but I did not found any way to change the uri. Also, when adding a hyperlink field type, the look and field is not the same as if I was adding an hyperlink from within Word.

thanks in advance

Benoit

>Hi Keith,

Thank you for evaluating Essential DocIO.

Currently we do not have support to insert hyperlinks to the document. I have added this as a feature request with our development team. You can track the live status of this feature here,

Feature Request #1170 - Add an ability to insert hyperlinks to the document.

However we have a support to preserve the hyperlinks from an excising template document. I have attached the sample for your reference. Please take a look at the sample and let me know if you have questions.

Thanks,
Prabhu.



>Hi, I'm evaluating DocIO and have not found reference on how to insert a mailto: and a URL into a Word document. Maybe I have just overlooked this functionality. Is it possible to insert these dynamically into a DocIO document so that Word displays them as links.

Thanks


Hyperlink_Preserve.zip



I agree


Loader.
Live Chat Icon For mobile
Up arrow icon