ISLibraryDocument.Print

Description

This function prints the specified library document.

Syntax

object.Print

Part Attribute Type Description
object Required
The object always implements the ISLibraryDocument interface

Example

Find the library document by its name and print it after user confirmation.

sub main
  Dim aDocumentName 
  Dim aLibrary
  
  aDocumentName = InputBox("Enter document name to search and print:")
  if aDocumentName = "" then exit sub
    
  Set aLibrary = Profile.LoadRootLibrary
  ProcessLibraryTree aLibrary, "", aDocumentName
end sub
     
sub ProcessLibraryTree(aLibrary, aPath, aDocumentName)
  Dim aFullPath
  Dim aDoc
  Dim aInfo
  Dim aResult 
  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
    aResult = MsgBox("Would you like to print document " & vbNewLine & aInfo & " ?",_
      vbYesNo, "Printing confirmation")
    if aResult = vbYes then aDoc.Print
  end if 
     
  for i = 0 to aLibrary.Count - 1
    ProcessLibraryTree aLibrary.SubLibrary(i), aFullPath, aDocumentName  
  next
end sub
Note:

In Profile Client v8 on User Interface the library document can be printed by clicking the 'Print selected document' button in Maintain > Library > Items toolbar.

Version information

Added in v7.9.0