Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



How can I send Integra output directly to a pre-defined printer?



When running an Integra profile which is set to Print, by default Integra for Notes presents the user with the standard Word or Excel print dialog box.This dialog would allow the user to choose the printer on which to print as well as a range of other printing options.A user my however wish to automate the process so that the printer onto which the particular Integra profile will send its output is predefined and no dialog box is presented to the user.This would allow for instance an action button to be set on a Notes form or view which immediaqtely triggers the the printout.This would be particularly useful if the desire is to print to a PDF file.

This can be achieved adding a few lines in the Callback Script field of the Advanced tab within the Integra profile:

Const CB_INITIALISE = 3
Const CB_BFORREADNOTES = 6
Const CB_BFORREADCOM = 7
Const CB_BFORWRITECOM = 1
Const CB_BFORWRITENOTES = 8
Const CB_BFORCOMACTION = 5
Const CB_BFORNOTESACTION = 2
Const CB_TERMINATE = 4

select case stats.cbstatus
case CB_INITIALISE
case CB_BFORREADNOTES
case CB_BFORREADCOM
case CB_BFORWRITECOM
case CB_BFORWRITENOTES
case CB_BFORCOMACTION
    ' In this example we chose to use a PDF writer/printer,
    ' Instead of "PDF995 on Ne00:" you need to add the appropriate printer name

    ' In case of an Excel profile
    stats.XlsAppl.ActivePrinter = "PDF995 on Ne00:"
    call stats.XlsWBook.PrintOut()

    ' In case of a Word profile
    ' stats.WordAppl.ActivePrinter = "PDF995 on Ne00:"
    ' call stats.WordAppl.PrintOut()

    export.continue = false
case CB_BFORNOTESACTION
    if not stats.savdoc is nothing then
      ' before save as...
    else
      ' before send to
    end if
case CB_TERMINATE
end select


So as to be sure of what the exact printer name is referred to by Word or Excel, it is possible to obtain the correct printer name by writing a simple (temporary) macro in Word or Excel which you run once just to capture the printer name. Open the template from the Integra profile and select Tools->Macro->Macros from the menu. In the presented dialog box type in a new macro name, for instance "Printer name test", and then click on the Create button. Add the following line to the macro:
msgbox Application.ActivePrinter

Before running the macro, print the Excel or Word template selecting the appropriate printer and click on OK; now you can run the "Printer Name Test" macro. The messagebox will show the name of the printer as it has to be assigned in the code example above.

.




FAQ# 0048
Bookmark and Share

 
QUICK LINKS
 
 

 

  © Shireburn Software Ltd. 2008 - 2024