This method will loop through all of the NavigationNode numbers and try to find the node number of the file with the corresponding name.

This function would need to be modified to accept the file name as an argument if you wanted to look for a file other than the ActiveDocument.

Function GetNavigationNodeNumber() _
As Integer
  On Error GoTo errHandler1
  Dim i As Integer

  'Loop through AllNavigationNodes
  For i = 0 To _
  Application.ActiveWeb.AllNavigationNodes. _
  Count - 1
    '.file.name will include the
    'file name extension
    'such as ".htm", so it needs to be added
    'to .nameProp which does not include it.
    If LCase(Application.ActiveWeb. _
    AllNavigationNodes.Item(i).File.Name) = _
    LCase(Application.ActiveDocument.nameProp & _
    ".htm") Then
      GetNavigationNodeNumber = i
      Exit Function
    End If
  Next i
  'If it finishes loop without finding name.
  GetNavigationNodeNumber = -1
  Exit Function
errHandler1:
  MsgBox "GetNavigationNodeNumber has failed.", _
  vbCritical, "Function failure."

End Function				

 

Valid XHTML 1.0 Transitional        Valid CSS!