How to Create Dynamic Page Numbering for Main and Detail Pages in Visio
Question details
The user needs to configure automated page numbering in Microsoft Visio that automatically recalculates when detail pages are inserted, deleted, or reordered.
- Product
- Microsoft Visio
- Device & OS
- not provided
- Scenario
- Documenting multi-page diagram systems requiring distinct dynamic numbering formats for main pages (e.g., 1 of 14) and detail pages (e.g., D1 of 13).
- Observed behavior
- Manual page numbering becomes unbalanced and inaccurate when detail pages are modified, requiring a dynamic formula-based solution to maintain accuracy.
Ensure you have Developer Mode enabled in Visio (File > Options > Advanced > Run in developer mode), as you will need access to the ShapeSheet to configure advanced dynamic numbering formulas.
Configure Dynamic Numbering Using Visio ShapeSheet
Utilize the PageNumber and User.TotalNumber fields within the ShapeSheet to automatically calculate and display page counts across different page types.
By leveraging Visio's ShapeSheet formulas, you can create a custom numbering system that distinguishes between main pages and detail pages. The PageNumber field automatically reflects a page's physical position in the document, ensuring that your numbering stays accurate even if pages are dragged into a new order or deleted.
Designate a background page where your page number shape will reside. This ensures the page number appears uniformly across all assigned foreground pages without needing to be pasted manually.
Draw a basic text block or shape at the bottom of the background page where you want the dynamic page number to appear.
Right-click the text shape and select 'Show ShapeSheet' from the context menu to access the formula backend for that specific shape.
In the Document ShapeSheet, create a User-defined cell (e.g., User.TotalDetailPages) to store the total count of your detail pages. You may need to manually update this constant or use a VBA macro to count specific page names.
In the Text Fields section of your shape's ShapeSheet, apply a formula combining standard text and your defined fields. For detail pages, enter a formula similar to: ="D" & PageNumber & " of " & User.TotalDetailPages.
Looking for a Cost-Effective Office Suite? Try WPS Office
While specialized diagramming tools like Visio require complex ShapeSheet configurations and high licensing costs, your everyday document creation should be straightforward and affordable. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for your daily word processing, spreadsheet, and presentation needs, complete with built-in flowcharting and diagramming tools.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the application: Run the setup file and follow the on-screen instructions to complete the fast, lightweight installation process.
- 3. Start creating documents: Open WPS Office to access Writer, Spreadsheets, and Presentation. You can easily insert and format dynamic page numbers in WPS Writer by navigating to the 'Insert' tab and clicking 'Page Number'.

Frequently Asked Questions
Why does my Visio page number not update when I delete a page?
If you manually typed the page number into a text box, it remains static and will not update. To enable automatic updates, you must use the 'Insert Field' feature and select 'Page Information > Page Number'.
How do I add a standard 'Page X of Y' format in Visio?
Click inside a text box, go to the Insert tab, and click 'Field'. First, insert 'Page Number' from the Page Information category, type the word ' of ', and then go back to Insert Field to add 'Number of Pages' from the Document Information category.
Can I restart page numbering for a specific section in Visio?
Visio does not feature native 'section breaks' for page numbering like Microsoft Word does. To restart numbering, you typically need to use custom ShapeSheet formulas, offset the PageNumber field mathematically, or split your diagram into separate Visio files.
How do I turn on Developer mode in Visio to access the ShapeSheet?
Go to File > Options > Advanced. Scroll down to the 'General' section at the bottom of the window and check the box labeled 'Run in developer mode'. Click OK. You can now right-click shapes to open their ShapeSheet.




