Attribute VB_Name = "Module_Outline" ' Outline - Automatically Numbering Heading tags. ' Copyright (C) 2002 Stephen C. Travis ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ' or visit their website at http://www.fsf.org/licenses/gpl.txt ' Sub Outline() If Not FrontPage.ActiveDocument Is Nothing Then If FrontPage.ActivePageWindow.ViewMode = fpPageViewNormal Then Dim h(6) strInfo = "" For Each el In ActiveDocument.all Num = Mid(el.tagName, 2) If Left(el.tagName, 1) = "h" And IsNumeric(Num) Then strLevel = "" iNum = CInt(Num) h(iNum) = h(iNum) + 1 For i = 1 To 6 If i > iNum Then h(i) = 0 Else strLevel = strLevel & "." & h(i) End If Next strLevel = Mid(strLevel, 2) strInfo = el.innerHTML For Each span In el.Children.tags("span") If span.id = "fp_OLN" Then strInfo = Replace(strInfo, span.innerHTML, "") End If Next strInfo = "" & strLevel & " " & "" & strInfo el.innerHTML = strInfo End If Next End If End If End Sub