Hello dear Aspose Team,
We recently discovered that OneNote files can contain embedded Loop components. These components do not seem to function locally without authentication. However, we noticed that modifying and re-uploading the file causes these Loop components to disappear.
Here is a sample file containing a Loop component:
https://files.axiomint.com/external/file/us16zc99f41e1744c42efa5bbe75fa131f74b
Here is the code that we are using
foreach (var page in document)
{
IList<RichText> richTexts = page.GetChildNodes<RichText>();
foreach (RichText richText in richTexts)
{
foreach (var textRun in richText.TextRuns)
{
ProcessTextRunLink(textRun);
}
}
}
....
private void ProcessTextRunLink(TextRun textRun)
{
var textStyle = textRun.Style;
if (!textStyle.IsHyperlink || string.IsNullOrWhiteSpace(textStyle.HyperlinkAddress))
{
return;
}
string linkPath = textStyle.HyperlinkAddress;
string linkText = textRun.Text;
this.AddLinkWithAction(linkPath, linkText, result =>
{
textStyle.HyperlinkAddress = result.UpdatedLinkPath;
textRun.Text = result.UpdatedLinkText;
});
}
We have the following questions:
- Is it possible to expose a property (either on the document or page level) to indicate if it contains Loop components? This would allow us to handle such files cautiously and avoid modifications.
- Can we retrieve a list of Loop components (along with their URLs) from the document or page?
More information about Loop components can be found in this Microsoft Support article.
P.S. We have also come across a similar feature request for the Aspose.Words product family: Insert Microsoft Loop Components in Word. While we do not require functionality to insert Loop components, we would like the ability to identify them in file types where they can be added.