Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Page Navigation

#Navigate to the first page
Document.ActivePageReference = Document.Pages[0]

#Loop Document Pages
for p in Document.Pages: print p.Title

#Toogle Page Navigation
if Document.Pages.NavigationMode == Document.Pages.NavigationMode.Tabs:
   Document.Pages.NavigationMode = Document.Pages.NavigationMode.Links
elif Document.Pages.NavigationMode == Document.Pages.NavigationMode.Links:
   Document.Pages.NavigationMode = Document.Pages.NavigationMode.None
elif Document.Pages.NavigationMode == Document.Pages.NavigationMode.None:
   Document.Pages.NavigationMode = Document.Pages.NavigationMode.Tabs



#Go to First page
Document.ActivePageReference = Document.Pages[0]

#Delete First page
Document.Pages[0].Remove()


#go to last page
Document.Pages[(Document.Pages.Count-1)]

#Delete last page
Document.Pages.RemoveAt(Document.Pages.Count-1)


#Delete all pages!
print Document.Pages.Clear()

#Create a page
p = Document.Pages.AddNew()
p.Title = "New Page"

#current page number
print Document.Pages.IndexOf(Document.ActivePageReference)

#total pages
print Document.Pages.Count

#current page index
Document.Pages.IndexOf(Document.ActivePageReference)

No comments: