[Sigia-l] Table of Contents in Visio

Mark Lawrence MLawrence at frontline-group.com
Thu Sep 5 14:25:52 EDT 2002


this works for me:

1) create a macro (Tools->Macros->Macro) and insert the following code:

'begin ==============================================================

Dim oPage As Page
Dim ofs As New Scripting.FileSystemObject
Dim fh As Scripting.TextStream

Set fh = ofs.OpenTextFile("C:\pagenames.txt", ForWriting, True)
For Each oPage In ActiveDocument.Pages
    fh.WriteLine """" & oPage.Name & """"
Next oPage
fh.Close

'end ==============================================================

2) Using the Visual Basic Editor (alt-F11), 
Select: Tools->References 
set a reference to:"Microsoft Scripting Runtime" 
(example above uses the Scripting file system object to create and write to
a file)

3) save the macro

4) run the macro

5) modify to suit your purposes (eg the page of the file to write to, etc.)

-----Original Message-----

> I'd like to generate a list of page names without having to hand type
them again.  




More information about the Sigia-l mailing list