Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Applying or removing the Hyperlink style by searching and replacing the underlying XML in the document

$
0
0

Search
<w:rStyle w:val="Hyperlink"/></w:rPr><w:t>http://www.bbc.co.uk</w:t></w:r></w:hyperlink>
Replace
http://www.bbc.co.uk

Hello,

I am trying to search and replace inside the XML within a Word .docx file. I am trying to eliminate the hyperlink style but retain the website address within the hyperlink. From what I can tell, the above search string specifies the start and end hyperlink tags, so I was trying replace the above search string with simply the replacement website address. When I ran this replacement, it corrupted the Word document. I then tried to remove retain various tags such as </w:rPr> or <w:t> or </w:t> or </w:r>, within the replacement string. Each of these attempts also corrupted the document.
Does anyone have a clue as to what I am doing wrong
(I need to run this replacement over many documents, so I cannot use the Word user interface.)

Many thanks.
Keith


R K Howard


Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>