1 # loop through pages 2 pg = 1 3 while pg <= ddp.pageCount: 4 # change current page 5 ddp.currentPageID = pg 6 7 # get name of current page 8 name = ddp.pageRow.getValue('NAME') 9 print name