InsertHyperlink url Prefixed with #

Hi,

Current version for ASPOSE.Words is 14.4.0.0.
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:
https://releases.aspose.com/words/net

Please check the following code:

// Create or load a document
Aspose.Words.Document wordDoc = new Aspose.Words.Document();

// Get first paragraph
Aspose.Words.Paragraph para = wordDoc.FirstSection.Body.FirstParagraph;
para.Runs.Add(new Run(wordDoc, "Some text. "));

// Add the hyperlink field to the paragraph
FieldHyperlink field = (FieldHyperlink)para.AppendField(Aspose.Words.Fields.FieldType.FieldHyperlink, false);
// URL
field.Address = @"""<https://www.aspose.com/>""";
// Text
field.Result = "Go to the Aspose website";
field.Update();

// Set color of the last run
para.Runs[para.Runs.Count - 1].Font.Color = System.Drawing.Color.Blue;

// Save the document
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 14.4.0.0. Earlier hyperlink was working fine.

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