Hyperlink node is converted to instrText
-
Monday, September 07, 2009 12:55 PMHi All,
I am using openxml sdk to get list of all hyperlinks....
I take external relationships ...and then take hyperlinks from the document.
Now, In some cases if the hyperlink is inserted at the top of the document the hyperlink xml node is converted to a instrtext node.
for example:
the proper hyperlink should be as mentioned below.....
< w:hyperlink r:id =" rId5 " w:history =" 1 " >< w:rStyle w:val =" Hyperlink " />< w:color w:val =" 000000 " />< w:u w:val =" none " /></ w:rPr >< w:t > [ </ w:t ></ w:r >< w:rStyle w:val =" Hyperlink " />< w:color w:val =" 000000 " />< w:u w:val =" none " /></ w:rPr >< w:t > FILED2] </ w:t ></ w:r ></ w:hyperlink >
for some reason some of the hyperlinks are converted to.....
< w:r w:rsidR =" 00EF38C9 " w:rsidRPr =" 00634185 " >< w:color w:val =" 000000 " /></ w:rPr >< w:fldChar w:fldCharType =" begin " /></ w:r >< w:color w:val =" 000000 " /></ w:rPr >< w:instrText xml:space =" preserve " > HYPERLINK "mito://mitVV_C103C8F8DD6E4362A284637EBC360B5E/" </ w:instrText ></ w:r >< w:color w:val =" 000000 " /></ w:rPr >< w:fldChar w:fldCharType =" separate " /></ w:r >< w:rStyle w:val =" Hyperlink " />< w:color w:val =" 000000 " />< w:u w:val =" none " /></ w:rPr >< w:t > [ </ w:t ></ w:r >< w:rStyle w:val =" Hyperlink " />< w:color w:val =" 000000 " />< w:u w:val =" none " /></ w:rPr >< w:t > FIELD1] </ w:t ></ w:r >< w:color w:val =" 000000 " /></ w:rPr >< w:fldChar w:fldCharType =" end " /></ w:r ></ w:p >
Again, this conversion is not done for all of the hyperlinks in the document. Some hyperlinks...(for exmple at the start of the document are converted into this instrText nodes.
so,open xml sdk is not able to identify the hyperlinks which are converted into instrText nodes.
while...word interop is able to identify all of these kind of hyperlinks in the document.
This hyperlinks are added to document by another part of my application.
If i insert a space before and after the hyperlink it is proper hyperlink node. But if I remove spaces it converts hyperlink nodes into instrText.
Please, let me know what should i do to keep the hyperlink as hyperlink node ...
Thanks,
Himanshu Pandey
All Replies
-
Thursday, August 18, 2011 4:27 AM
I seem to be having the same issue.
Did you ever determine what was causing it?
Jonathan Wood • Black Belt Coder -
Tuesday, May 15, 2012 9:01 AM
Like the previous two posts, I'm also experiencing the same issue.
Has anyone managed to figure out why this is happening?
It appears to be very random when it is inserting < w:instrText xml:space =" preserve "> nodes on seemly identical inserts of hyperlinks.

