We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

InsertHyperlink url Prefixed with #


Current version for ASPOSE.Words is

I am inserting hyperlink in document using below

docBuilder.InsertHyperlink(hyperlinkText, hyperlinkUrl, false);

When i do CTRL + Click on the hyperlinkText it redirects nowhere. when i edit hyperlink it shows # prefixed with the URL.

Any suggestion to fix the issue?

Hi Deepak,

Thanks for your inquiry. Please upgrade to latest version of Aspose.Words from the following link:

Please check the following code:
// Create or load a document

Aspose.Words.Document wordDoc = new Aspose.Words.Document();<o:p></o:p>

<o:p> </o:p>

// Get first paragraph<o:p></o:p>

Aspose.Words.Paragraph para = wordDoc.FirstSection.Body.FirstParagraph;<o:p></o:p>

para.Runs.Add(new Run(wordDoc, “Some text. “));<o:p></o:p>

<o:p> </o:p>

// Add the hyperlink field to the paragraph<o:p></o:p>

FieldHyperlink field = (FieldHyperlink)para.AppendField(Aspose.Words.Fields.FieldType.FieldHyperlink,false);<o:p></o:p>

// URL<o:p></o:p>

field.Address = @””“http://www.aspose.com”"";<o:p></o:p>

// Text<o:p></o:p>

field.Result = “Go to the Aspose website”;<o:p></o:p>


<o:p> </o:p>

// Set color of the last run<o:p></o:p>

para.Runs[para.Runs.Count - 1].Font.Color = System.Drawing.Color.Blue;<o:p></o:p>

<o:p> </o:p>

// Save the document<o:p></o:p>

wordDoc.Save(MyDir + @“15.6.0.docx”);

I hope, this helps.

Best regards,

Thank you Hafeez,

Upgrading to latest version will involve round of Testing cycles . Is there any work around to get hyper link working using ASPOSE.Words14.4.0.0. only?

Thanks in advance

Hi Deepak,

Thanks for your inquiry. Unfortunately, we don’t provide support for older released versions of Aspose.Words. We do not provide any fixes or patches for old versions of Aspose products either. All fixes and new features are always added into new versions of our products. Also, please note that we exercise Unit Testing and all of our unit tests are properly structured. Upgrading to the latest version of Aspose.Words is safe and it should cause no undesired behaviour. Since all Aspose.Words functionality is unit tested so everything in the previous versions shall still be working in the newer versions. If we can help you with anything else, please feel free to ask.

Best regards,

I can understand, but his issue occurred when we upgraded to the Earlier hyperlink was working fine.

We are planing to upgrade this will take some time. Thank you very much for prompt response.