Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List of Pages in Document 1

Status
Not open for further replies.

eman6

Programmer
Dec 7, 2004
578
CH
Hi everybody.
Tools _ Customize_Edit --> (List of Pages in document)

I suppose this allows me to create a list of specific pages in the document. I hope I can make a list by page titles, not just page numbers.
The question is: How do I populate the list?
In other words, how do I add the pages I want to the list?

Thank you in advance.

______________________________________
Eman6
Technical User
 
Rather than using the tabs at the bottom of the page, this command will present a list of the pages in the menu so that you can use the menu to navigate the pages.

If you want to create something like a table of content, then you need to use code (VBA). There is an example of a TOC at


John... Visio MVP
 
Thank you for your reply.
The problem is, in my document (process description) there are three stages 1)Planning 2) Execustion 3) Analysis
So I would like to have three lists (groups) of chapters (flow pages) to allow the reader to selectively jump to the page s/he wants within the stage relevant to her/his activity.
Also, some managers might want to select some pages to print, by page title rather than by page number.
There must be a way (code or not) to create a custom menu including items that I define myself, or a free selection of pages.

______________________________________
Eman6
Technical User
 
Hi eman6

I have done something similar to generate table of contents with different types of pages on each.
As a way of determining the different stages I added a custom property to the sheets and then checked that when adding items to the table of contents.
If the pages are different and are generated from a template you can add the custom property to each of the base sheets.

For printing the selection of sheets you will need to use the individual sheets print command
Quick example below using a listbox and one command button on a userform this uses the default printer.
Set the listbox to have multiselection-extended
This is the code

Code:
 Private Sub CommandButton1_Click()

Dim i as Integer
Dim vsoDocumentTemp As Object
For i = 0 To ListBox1.ListCount - 1
    If ListBox1.Selected(i) Then
        Set vsoDocumentTemp = Visio.ActiveDocument.Pages(i + 1)
        strDummy = vsoDocumentTemp.Print

    End If
Next

End Sub

Private Sub UserForm_Initialize()

Dim i As Integer
Dim vPage As Visio.Page

For i = 1 To Visio.ActiveDocument.Pages.Count
    
    Set vPage = Visio.ActiveDocument.Pages(i)
    ListBox1.AddItem vPage.Name

Next

End Sub

This allows you to select the pages and then press the button sending the pages direct to the printer, to change printer setting have a look at the MSDN website.

For the custom menus look at the msdn webpage
[URL unfurl="true"]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/vimthSetCustomMenus_HV81900927.asp[/url]
This is for Visio 2003

Cjo9900
 
Hi Cjo900
Thank you for the reply and for the code.
The idea of the custom properties is certainly interesting.
I did not know that custom properties could be assigned to pages.
I thought I could do that only to objects within a page.
Rather, I was trying to see if I could add a bookmark.
But could not find a bookmark function in Visio :(

Thank you again.

Kind regards



______________________________________
Eman6
Technical User
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top