logo
search
Others

How to Automatically Number Detail Pages in Microsoft Visio

Elise WilliamsElise Williams Sep 28, 2026 869 views

Question details

The user needs to automate the page numbering for Visio detail pages in a specific format (e.g., D1 of Total), ensuring it updates dynamically when pages are added or removed.

How to Automatically Number Detail Pages in Microsoft Visio
Product
Microsoft Visio
Device & OS
not provided
Scenario
Managing a multi-page Visio document that contains a mix of main pages and a varying number of detail pages.
Observed behavior
The current numbering formula relies on a fixed, hardcoded total (e.g., 13), causing the page labels to become inaccurate whenever new detail pages are inserted or existing ones are deleted.
Before you start

Ensure that all your detail pages share the exact same background page in Visio, as this shared background will be used as the criteria to count them dynamically.

Solution 1Recommended

Use Visio ShapeSheet Formulas to Dynamically Count Detail Pages

By replacing the fixed number with a dynamic ShapeSheet calculation that counts pages sharing the detail background, your page labels will automatically update during document edits.

Instead of hardcoding a total like '13' in your text fields, you can leverage Visio's Document ShapeSheet to count how many pages use a specific background. Combining this with the PageNumber() function ensures accurate numbering regardless of page insertion or deletion.

1
Enable Developer Mode

Open Microsoft Visio and navigate to File > Options > Advanced. Scroll down to the General section at the bottom and check the box for 'Run in developer mode', then click OK.

2
Open the Document ShapeSheet

Right-click anywhere on a blank space within your drawing page, select 'Show ShapeSheet', and choose 'Document'.

3
Create a User-Defined Cell

In the ShapeSheet window, scroll to the 'User-defined Cells' section. Right-click the section, choose 'Insert Row', and name the new row 'User.TotalDetailPages'.

4
Calculate the Total Pages

In the Value cell for User.TotalDetailPages, enter a formula that counts the pages linked to your detail background. For example, if you use a specific background, write a formula utilizing the appropriate document scope to sum them up.

5
Format the Numbering Text

Go to your detail background page, insert a text box, and use the Field dialog to insert a custom formula: ="D" & PageNumber() & " of " & TheDoc!User.TotalDetailPages.

Use Visio ShapeSheet Formulas to Dynamically Count Detail Pages
Testing the Formula: Always test your new dynamic formula by inserting, deleting, and rearranging detail pages to verify that both the current page number and the total automatically refresh.
Free Microsoft Office alternative

Try WPS Office for Free Diagramming and Documentation

While complex ShapeSheet programming requires Microsoft Visio, WPS Office offers a fantastic free alternative for managing everyday documents, spreadsheets, presentations, and standard flowcharts without the hefty price tag.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install the Suite: Run the setup file and follow the quick installation prompts to get started.
  3. 3. Start Creating Diagrams: Open WPS Writer or Presentation, navigate to the Insert tab, and use the Shapes feature to build your diagrams.
Highly compatible with Microsoft Word, Excel, and PowerPoint file formats.Built-in drawing and shapes tools allow you to quickly create flowcharts and diagrams.Lightweight installation ensures your device runs smoothly without heavy resource usage.Free to download with a familiar and intuitive user interface.
microsoft office alternative - wps office

Frequently Asked Questions

How do I access the ShapeSheet in Microsoft Visio?

To access the ShapeSheet, you must first enable Developer Mode in Visio Options under the Advanced settings. Once enabled, you can right-click any shape, page, or the document canvas and select 'Show ShapeSheet'.

Why isn't my page number updating when I delete a Visio page?

If your total page count is typed as plain text (like '13') instead of a dynamic field, it will not update automatically. You must use Visio's Insert Field feature combined with the PageNumber() function to ensure dynamic updates.

Can I use different numbering systems for main pages and detail pages?

Yes. By assigning a distinct background page for main pages and another for detail pages, you can insert different ShapeSheet formulas into each background. This isolates the numbering so that detail pages count independently from main pages.