ISLibrary.GetDocumentByName

Description

This function returns the library document by its name.

Syntax

object.GetDocumentByName(aName)

Part Attribute Type Description
object Required
The object always implements the ISLibrary interface
aName In, Required
string
The name of the document

Return Value

ISLibraryDocument

Returns the library document by its name.

Example

Display the full paths to the library documents by their names.

sub main
  Dim aDocumentName 
  Dim aLibrary
  Dim aMessage
  
  aDocumentName = InputBox("Enter document name:")
  if aDocumentName = "" then exit sub
    
  Set aLibrary = Profile.LoadRootLibrary
  aMessage = GetLibraryInfo(aLibrary, "", aDocumentName) 
  Profile.MsgBox (aMessage)    
end sub
     
function GetLibraryInfo(aLibrary, aPath, aDocumentName)
  Dim aFullPath
  Dim aDoc
  Dim aInfo
  Dim i
    
  if aPath <> "" then        
    aFullPath = aPath & "\" & aLibrary.Name
  else
    aFullPath = aLibrary.Name
  end if
        
  set aDoc = aLibrary.GetDocumentByName(aDocumentName)
  if not aDoc is nothing then
    aInfo = aFullPath & "\" & aDoc.Name
  else
    aInfo = ""  
  end if 
     
  for i = 0 to aLibrary.Count - 1
    aInfo = aInfo & vbNewLine & GetLibraryInfo(aLibrary.SubLibrary(i), aFullPath, aDocumentName)  
  next
  
  GetLibraryInfo = aInfo
end function
Note:

In Profile Client v8 on User Interface Library Document Name can be found in Maintain > Library > Document list > Name.

Version information

Added in v7.10.60