{"id":2676,"date":"2016-03-18T11:38:58","date_gmt":"2016-03-18T11:38:58","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?page_id=2676"},"modified":"2018-05-31T22:25:41","modified_gmt":"2018-05-31T22:25:41","slug":"set-openxmlstring","status":"publish","type":"page","link":"https:\/\/www.ericwhite.com\/blog\/set-openxmlstring\/","title":{"rendered":"Set-OpenXmlString"},"content":{"rendered":"<p>Following is a screen-cast that shows how to use Set-OpenXmlString.<\/p>\n<p><iframe loading=\"lazy\" title=\"Set-OpenXmlString.wmv\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/uDZ9JTR-ero?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>One of the problems of search-and-replace is that the string that matches the search string could be broken up into multiple runs.&nbsp; If you are interested in the algorithm that Set-OpenXmlString uses for searching and replacing, see <a href=\"https:\/\/www.ericwhite.com\/blog\/introducing-textreplacer-a-new-class-for-powertools-for-open-xml\/\">Introducing TextReplacer: A New Class for PowerTools for Open XML<\/a>.&nbsp; While the screen-cast shows only the algorithm for WordprocessingML, the algorithm for PresentationML is nearly identical.&nbsp; For a slightly different take on search-and-replace, see <a href=\"https:\/\/www.ericwhite.com\/blog\/search-and-replace-text-in-an-open-xml-wordprocessingml-document\/\">Search and Replace Text in an Open XML WordprocessingML Document<\/a>, which shows the algorithm using XmlDocument instead of LINQ to XML and a functional programming approach.<\/p>\n<p>This code uses an approach similar to that of <a class=\"ExistingPageLink\" href=\"http:\/\/ericwhite.com\/blog\/merge-openxmldocumentcomment\/\" title=\"Click to view the page titled: Merge-OpenXmlDocumentComment\">Merge-OpenXmlDocumentComment<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following is a screen-cast that shows how to use Set-OpenXmlString. One of the problems of search-and-replace is that the string that matches the search string could be broken up into multiple runs.&nbsp; If you are interested in the algorithm that Set-OpenXmlString uses for searching and replacing, see Introducing TextReplacer: A New Class for PowerTools for [&hellip;]<\/p>\n","protected":false},"author":10567,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"class_list":["post-2676","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/10567"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=2676"}],"version-history":[{"count":3,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2676\/revisions"}],"predecessor-version":[{"id":7345,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2676\/revisions\/7345"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=2676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}