Triggering PAGENUMBER()

Started by DavidJT, December 22, 2014, 08:49:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DavidJT

I have created a table of contents object that stays current with changes to page names but fails to keep the page number current.  What I have found is consistent behavior to many areas that I have googled, the PAGENUMBER() function only appears to refresh when a page is move up the pages stack and does not update when moved down the stack.  When Page-x is move from page 3 to page 5, PAGENUMBER() correctly returns a 5.  When Page-x is moved from page 5 to page 3, PAGENUMBER() continues to return a 5.  Likewise, any PAGENUMBER() reference to a page that was not moved does not update.

I can keep the formulas current in the event of adding/deleting pages or renaming the page by using the DEPENDSON function:

User.PageNumber = Pages[Page-x]!ThePage!PAGENUMBER() + DEPENDSON(PAGECOUNT()) + DEPENDSON(Pages[Page-x]!ThePage!PAGENAME())

Since the PAGENUMBER() function is not triggered to update when pages are renumbered I was looking for a workaround, something else that I could trigger on.  Any ideas?  Current, I can only see the user having to manually take action "Refresh Page Numbers" where the unseen action taken is to add and delete a page for the DEPENSON(PAGECOUNT()) portion of the formula above to cause the User.PageNumber fields to refresh.

Thanks

wapperdude

Yes, the pagenumber() seems to lack triggering.  Not discovered a work-around. 

Rhetorical question:  Since you have the page name, why do you need what seems like redundant info, i.e., page number?  Perhaps you can do without?

Wapperdude.
Visio 2019 Pro

DavidJT

I am building a dynamic Table of Contents, which would be a bit odd to not include the page number that the user needs to turn to...  My solution was to simply add a "Refresh Page Numbers" action on the table that adds and deletes a new page, impacting the page count.  Where I use the PAGENUMBER() function I include a +DEPENDSON(PAGECOUNT()) to the formula so this action then triggers that page numbers to update.