Daisy Analysis Print HTML File - Active X - Programming

Multiple Browser
New in 2004
New in 2003
Applications
Testimonials
Features
Specialist Browsers
Other Programs
  Auto Backup/FTP

  Double Browser

  Editing Browser

  Page Pull

  Print HTML File

    Applications

    Selective Printing

    Register

    Active X

      Dazy2004WebPrint

      Programming

        Events

        Methods

        Properties

        Browser Headers

      Distribution

  Refreshing Browser

  VB Mailer

  Web Site Spider

  WhoIs

  Zip Mailer

Screen Shots
Download
Versions
Register
Links
Contact

Previous  Next  Help  Print

Programming of the ActiveX component is very simple.

The example here refers to Visual Basic but as there are only a few lines of code, it should be easy to adopt to another programming language.


Visual Basic Test Project

If you are using Visual Basic open the project called Daisy Print HTML Test, which is stored in the SourceFiles sub-directory of where the Daisy Web Tools were installed. Typically this will be :-

   C:\Program Files\Daisy Analysis\Daisy 2000\SourceFiles

This is a very simple program that just prints the same file, DaisyPrintHTML.html.


Print Code

Look at the code below which prints the file in the form, frmDaisyPrintHTML :-

  Private Sub cmdPrint_Click()
      Dim wrkError As String
      Dim wrkPath As String
      On Error Resume Next
      wrkPath = Daisy2004WebPrint1.BuildPath(App.Path, "DaisyPrintHTML.html")
      Daisy2004WebPrint1.ProgramName = "Daisy"
      Daisy2004WebPrint1.NoHeaders = True
      Daisy2004WebPrint1.NoLinks = True
      If (Daisy2004WebPrint1.PrintPageFormatted(wrkPath, wrkError) = False) Then
          Daisy2004WebPrint1.MessageError wrkError
      End If
  End Sub

Note :-

  1. This is the code for the cmdPrint command button labelled Print... on the form, frmDaisyPrintHTML.

  2. Daisy2004WebPrint1 is the instance of the component, Dazy2004PrintHTML, on the form.

  3. Daisy2004WebPrint1 has it's property, Visible, set to False.

  4. The variable, wrkPath, is set to the path of the file to be printed. Note that the file, DaisyPrintHTML.html, is stored in the SourceFiles sub-directory.

  5. The properties, ProgramName, NoHeaders and NoLinks are set accordingly.

  6. The method, PrintPageFormatted, is used to actually print the page.

  7. If an error occurs, it is returned in the variable, wrkError, and then displayed using the method, MessageError.


Unlocking the Control

The code shown here can be used freely, but it will produce a rather annoying message every time it is used.

If you register the control, then you will be supplied with an appropriate method of unlocking the control.


Events, Methods and Properties

The various events, methods and properties in the control do a lot more than just print HTML files and are described separately.

A lot of these have been added, so that Daisy Analysis can write special purpose print programs without using any other controls.

Examples also show how to use these events, methos and properties :-