Free Support Forum - aspose.com

Issue while converting hyperlinks to DOCX format

Hi Team,

The issue is appeared in 18.7 version.
Seems that WORDSNET-16965 fix leads to incorrect converting internal links to external.

Please see test.doc and result.docx (just open it) attached:
test.zip (12.3 KB)
result.zip (11.6 KB)

Source code:
var document = new Document(“C:\test.doc”);
document.Save(“C:\result.docx”, SaveFormat.Docx);

I have wrote some workaround, maybe it help you to investigate the issue:

foreach (Aspose.Words.Fields.Field field in document.Range.Fields)
			{
				if (field.Type == Aspose.Words.Fields.FieldType.FieldHyperlink)
				{
					Aspose.Words.Fields.FieldHyperlink hyperlink = (Aspose.Words.Fields.FieldHyperlink)field;

					if (hyperlink.SubAddress == null && hyperlink.Address.StartsWith("#"))
					{
						var address = hyperlink.Address.Remove(0,1);

						hyperlink.Address = String.Empty;
						hyperlink.SubAddress = address;
					}

				}
			}

Thanks.

@spectr100

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-17463. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-17463) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.