<?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: Export Data Driven Pages to MXD with file name by Page Name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108639#M8396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following code will generate 5 MXDs based on each great lake name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\GreatLakes.mxd")
ddp = mxd.dataDrivenPages
for pageNum in range(1, ddp.pageCount + 1):
&amp;nbsp; ddp.currentPageID = pageNum
&amp;nbsp; print "Saving %s.mxd" %(ddp.pageRow.getValue(ddp.pageNameField.name))
&amp;nbsp; mxd.saveACopy(r"C:\Temp\\" + ddp.pageRow.getValue(ddp.pageNameField.name) + ".mxd")
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:33:12 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2021-12-11T06:33:12Z</dc:date>
    <item>
      <title>Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108631#M8388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I`m trying export &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;multiple files&lt;/SPAN&gt;&lt;SPAN&gt; created by &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;DDP&lt;/SPAN&gt;&lt;SPAN&gt; to ".mxd" once each page has the file name defined by the "page name" or by a "field name". Some what the ArcGis already does to export to ".pdf" whereas it e&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;xports single-page documents using the page name for the output file name&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Verdana;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw a script from Ideas webpage: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://ideas.arcgis.com/ideaView?id=08730000000boHXAAY" rel="nofollow" target="_blank"&gt;Export Data Driven Pages to MXD&lt;/A&gt;&lt;SPAN&gt; which is almost perfect to me, but the file name came from &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;Page number.&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I`ve tried modify It considering all the information that I saw on another pages (Help, ArcGIS Ideas, Foruns), but it doesn`t works until now. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like that somebody can helps me. I've made a copy from the last version of script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt;import arcpy, os &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxdPath = r"C:\...\Projeto_DataDrive.mxd" # The original path is too large&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd = arcpy.mapping.MapDocument(mxdPath)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxdDir = os.path.dirname(mxdPath)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... pageName = mxd.dataDrivenPages.pageRow.COD_APRT #This line wasn't here in the original script. &lt;/SPAN&gt;&lt;SPAN style="color:#0000ff;"&gt;The FieldName who is indexing the DDP is COD_APRT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd.dataDrivenPages.currentPageID = pageNum&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxdName = os.path.join(mxdDir, "DDPMap" + str(pageName) + ".mxd")# &lt;/SPAN&gt;&lt;SPAN style="color:#0000cd;"&gt;I just modified str(pageNum) to str(pageName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... mxd.saveACopy(mxdName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... del mxd&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will appreciate any help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2012 22:23:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108631#M8388</guid>
      <dc:creator>BrunoDeus</dc:creator>
      <dc:date>2012-01-10T22:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108632#M8389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe the issue was that you were setting the new pageName variable before changing the currentPageID.&amp;nbsp; I swapped the two lines.&amp;nbsp; I just tried the following and it worked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os 
mxdPath = r"C:\Temp\DDP.mxd"
mxd = arcpy.mapping.MapDocument(mxdPath)
mxdDir = os.path.dirname(mxdPath)
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum
&amp;nbsp;&amp;nbsp;&amp;nbsp; pageName = mxd.dataDrivenPages.pageRow.NAME
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxdName = os.path.join(mxdDir, "_" + str(pageName) + ".mxd")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print mxdName
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.saveACopy(mxdName)
del mxd&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108632#M8389</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-11T06:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108633#M8390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I sorry to have came late, but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;It Works, Thanks for helping Jeff!!!&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 22:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108633#M8390</guid>
      <dc:creator>BrunoDeus</dc:creator>
      <dc:date>2012-01-12T22:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108634#M8391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I am too having a similiar problem, probably more has to do with being new to Python and such. Code is below - What I am trying to do is export my mapbook by the page name I set it to using my data driven page layer. The attribute name is SHEET. The file it is based on is MAPGATHERINGGRD. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("S:\GIS\Appalachia\Map Projects\Midstream\Exhibits\Gathering Maps\Gathering Mapbook.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pageName = mxd.dataDrivenPages.pageROW.SHEET&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r"C:\Temp\Gathering_Page" + str(pageName) + ".pdf")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any guidence would help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 18:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108634#M8391</guid>
      <dc:creator>RickySones</dc:creator>
      <dc:date>2012-03-09T18:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108635#M8392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know for certain, but there might be two issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to change your mxd path to one of the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(&lt;/SPAN&gt;&lt;STRONG&gt;r&lt;/STRONG&gt;&lt;SPAN&gt;"S:\GIS\Appalachia\Map Projects\Midstream\Exhibits\Gathering Maps\Gathering Mapbook.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("S:\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;GIS\Appalachia\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;Map Projects\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;Midstream\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;Exhibits\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;Gathering Maps\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;Gathering Mapbook.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("S:/GIS/Appalachia/Map Projects/Midstream/Exhibits/Gathering Maps/Gathering Mapbook.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try changing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;pageName = mxd.dataDrivenPages.pageROW.SHEET&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;To:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;pageName = mxd.dataDrivenPages.pageRow.SHEET&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Joel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 18:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108635#M8392</guid>
      <dc:creator>JoelCalhoun</dc:creator>
      <dc:date>2012-03-09T18:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108636#M8393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is exactly what I need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please provide more detailed instructions for using the python script, as I am new to both python and DDP. I am not sure which elements of the script are personalized and which are generic code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gabrielle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2012 15:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108636#M8393</guid>
      <dc:creator>GabrielleGrode</dc:creator>
      <dc:date>2012-12-21T15:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108637#M8394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are simply trying to export all pages using the page name as the output pdf name, try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy mxd = arcpy.mapping.MapDocument(r"S:\GIS\Appalachia\Map Projects\Midstream\Exhibits\Gathering Maps\Gathering Mapbook.mxd") ddp = mxd.dataDrivenPages ddp.exportToPDF(r"C:\Temp\Page", "ALL", multiple_files = "PDF_MULTIPLE_FILES_PAGE_NAME"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will produce a bunch of pages using the DDP index name field with a "Page" prefix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2012 15:32:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108637#M8394</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-12-26T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108638#M8395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Jeff. Actually, I want to export the maps to mxd files so I can do some final tweaking on individual map documents. I would like the individual map documents to be called the name of the DDP. I see the sample codes from the above strings, but I don't know which parts of the code I should personalize to my unique project. Any help is much appreciated. Thanks! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gabrielle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 12:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108638#M8395</guid>
      <dc:creator>GabrielleGrode</dc:creator>
      <dc:date>2012-12-28T12:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108639#M8396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following code will generate 5 MXDs based on each great lake name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\GreatLakes.mxd")
ddp = mxd.dataDrivenPages
for pageNum in range(1, ddp.pageCount + 1):
&amp;nbsp; ddp.currentPageID = pageNum
&amp;nbsp; print "Saving %s.mxd" %(ddp.pageRow.getValue(ddp.pageNameField.name))
&amp;nbsp; mxd.saveACopy(r"C:\Temp\\" + ddp.pageRow.getValue(ddp.pageNameField.name) + ".mxd")
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:33:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108639#M8396</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-11T06:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108640#M8397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This thread has been great as I am also new to using python scripts.&amp;nbsp; I have a python script that works fine within the actual mxd workspace but I would like it to run outside of the mxd workspace.&amp;nbsp; If I run the the python script outside of the mxd workspace it gives me no errors but results in no PDF's.&amp;nbsp; Can anyone give me a clue to what I am doing wrong? (To clarify, I want to run the python script as a scheduled windows task).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-----------------------------------&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, string&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument(r"V:\TEMP\MapBooktest\engGIS\Zoning.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ddp = mxd.dataDrivenPages&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;indexLayer = ddp.indexLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for pageNum in range(1, ddp.pageCount + 1):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp.currentPageID = pageNum&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pageName = ddp.pageRow.FACET_NO&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r"V:\TEMP\MapBooktest\engGIS\PDFtestMapbook\Zoning_" + pageName + ".pdf")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 15:15:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108640#M8397</guid>
      <dc:creator>MichelleNing</dc:creator>
      <dc:date>2013-08-21T15:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108641#M8398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrea, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I just figured out how to fix this same issue a couple weeks ago. You need to add an extra "\" to the end of your export location: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ddp.exportToPDF(r"O:\Missouri\MO18\Details\2013 Create from NISC GIS\TEST\&lt;/SPAN&gt;&lt;STRONG&gt;\&lt;/STRONG&gt;&lt;SPAN&gt;" + str(bookNum) + "_" + str(pageName) + ".pdf", "CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 17:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108641#M8398</guid>
      <dc:creator>MichelleNing</dc:creator>
      <dc:date>2013-11-21T17:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export Data Driven Pages to MXD with file name by Page Name</title>
      <link>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108642#M8399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;THANK YOU!!! I knew it was a syntax error but I didn't know what or why. &lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You're welcome! You need to add a extra backslash because '\' is a special character in python.&amp;nbsp; I'm just learning how to utilize python too.&amp;nbsp; This link might help clarify when you need to use it when you use special characters in your code:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/node48.html"&gt;http://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/node48.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 17:22:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-data-driven-pages-to-mxd-with-file-name-by/m-p/108642#M8399</guid>
      <dc:creator>MichelleNing</dc:creator>
      <dc:date>2013-11-21T17:22:49Z</dc:date>
    </item>
  </channel>
</rss>

