Link to home
Start Free TrialLog in
Avatar of BeGentleWithMe-INeedHelp
BeGentleWithMe-INeedHelpFlag for United States of America

asked on

visio (may also apply to excel ? ) how do you make a table of contents page with other page names?

You guys have helped me with other visio issues and I learned about pagename() which returns the name of the current page of the visio doc (and likely woudl do the same in excel?).

I want to make a page with a list of page names - like a table of contents

is there a way to use pagename or other function for that?  

like pagename(1) returns the name of page 1
pagename(2) would return page 2's name, etc.

so i'd just have a series of lines

pagename(1)
pagename(2)
pagename(3)


I know - that number won't do what I want.  Is there another way?  other than cut / paste page names?

I really don't care about order / the order won't change (is it page 1 now, but if I drag a page in front of that one in the list of pages at the bottom of the window, would that now be page 2?  Don't care so much.  just trying to not type each page name manually
ASKER CERTIFIED SOLUTION
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BeGentleWithMe-INeedHelp

ASKER

Sorry, I'm just lazy / too complicated to do in a macro / I didn't really see that macro in the answer.

I did try it and I guess it gets me what I want... I guessi was hoping to be able to do it in formulas.

thanks
Not a problem -- I was just curious whether the macro route worked for you or not. If it doesn't, not problem. There's more than one way to get the job done. And thanks for awarding the points, but I haven't even answered your question yet!

The key to the answer is an additional Visio function, Pages[ ] (note the square brackets not parentheses) that returns a page object. It's kind of like what you wanted the pagename() function to do, but you'll end up using both in the same formula, which is:
    Pages[Page-n]!ThePage!Pagename()
where "Page-n" is the page name of the page you want to refer to; "ThePage" refers to the ShapeSheet for the target page; and "Pagename()" you already know about.

Essentially this is what you need to do:
1) Drop or draw a shape on the TOC page.
2) Insert>Field
3) Select Custom Formula
4) Type "Pages[Page-2]!ThePage!Pagename()
5) Repeat for additional pages, changing "Page-2" to "Page-3", etc.

Advantages of this approach:
1) The formulas will still work if you rename pages.
2) The formulas will still work if you reorder pages.

Disadvantages of this approach:
1) It's not automated so if you add more pages you need to add more shapes.
2) If you've renamed any pages in the diagram before you type the Pages[ ] function, the required work is a bit more complicated than what I've listed above. (If you need to know more about this, just let me know.)
3) There are no hyperlinks from the TOC to the target pages -- you'll need to create them manually.

I've attached a diagram that includes shapes created according to the steps above.
Pagename-function-to-create-pseu.vsd
thanks, I'll check it out.  It's more for printing out / making it look nice on paper for the client rather than a live doc, so hyperlinks aren't important.