<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: trying to change text with ListLayoutElements,  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577256#M45283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to BOTH responses. It worked beautifully!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 19:09:14 GMT</pubDate>
    <dc:creator>petegillard</dc:creator>
    <dc:date>2017-01-19T19:09:14Z</dc:date>
    <item>
      <title>trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577253#M45280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it only works searcing with actual string. can't find the text when i use&amp;nbsp; * . changing date and path strings, so they're not all the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex.&lt;/P&gt;&lt;P&gt;for dA in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dA.text == 'DATE: 10/10/2011':&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dA.text = 'Date: &amp;lt;dyn type="date" format=""/&amp;gt;'&amp;nbsp; &lt;STRONG&gt;THIS WORKS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for fp in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fp.text == 'FILE: *':&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fp.text = 'Document Path: &amp;lt;dyn type="document" property="path"/&amp;gt;' &lt;STRONG&gt;THIS DOESN'T WORK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any ideas.&lt;/P&gt;&lt;P&gt;Pete&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 16:15:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577253#M45280</guid>
      <dc:creator>petegillard</dc:creator>
      <dc:date>2017-01-19T16:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577254#M45281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe try the reverse logic to this.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the in operater you can check if a string contains a subtring, that way you don't need a wildcard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for fp in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp;'FILE: ' in fp.text:&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fp.text = 'Document Path: &amp;lt;dyn type="document" property="path"/&amp;gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method"&gt;http://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577254#M45281</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-01-19T18:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577255#M45282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... or:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;if fp.text.startswith('FILE: '):&amp;nbsp;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:13:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577255#M45282</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2017-01-19T18:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577256#M45283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to BOTH responses. It worked beautifully!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 19:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577256#M45283</guid>
      <dc:creator>petegillard</dc:creator>
      <dc:date>2017-01-19T19:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577257#M45284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to BOTH responses. It worked beautifully!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 19:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577257#M45284</guid>
      <dc:creator>petegillard</dc:creator>
      <dc:date>2017-01-19T19:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: trying to change text with ListLayoutElements,</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577258#M45285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please mark the question as answered?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 19:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-change-text-with-listlayoutelements/m-p/577258#M45285</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-01-19T19:39:21Z</dc:date>
    </item>
  </channel>
</rss>

