When applying hyperlinks to text in a word document, portions are not colored blue and underlined like the rest of the text.
It seems to be based on some hidden formatting of the underlying document. I've attached an example initial document and resulting document with hyperlinks inserted. The line marked fresh text results in a correctly styled hyperlink. The second example which was pasted from the user document has a malformed hyperlink style applied with part of the text still black with no underline.
The style issue is only present with the specific text pasted from a user document. I used design mode and the style viewer to attempt to view any hidden data applied to the text but I could not see any difference.
I was wondering if you could tell what about the problem text is causing aspose to fail to apply the hyperlink style consistently. I've pasted the code which is applying the hyperlink styles to the document and the example documents are attached.
Node start = match.get(0);
// Create an empty text hyperlink directly before the match
Field hyperlink = docBuilder.insertField(String.format(LOCAL_HYPERLINK_CODE_FORMAT, linkDef.getBookmarkName(), "Appended Authority"), "");
// Field hyperlink = docBuilder.insertHyperlink("", linkDef.getBookmarkName(), true);
for (Node nd : match)
if (nd.getNodeType() == NodeType.RUN)
// ((Run) nd).getFont().setStyleIdentifier(StyleIdentifier.HYPERLINK);
//More consistent to set each than use the StyleIdentifier
start = nd;
// Move the link's end-marker to directly follow the end of the match
// so that the hyperlink contains the full matching text.
FieldEnd hyperlinkEnd = hyperlink.getEnd();