Results 1 to 4 of 4

Thread: Printing contents of a ListBox control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Scarsdale, NY
    Posts
    26

    Post

    Does anyone know how to print contents of a ListBox control?
    Please, help.

    Thanks,

    Olga

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Something along the lines of this should work for you:
    Code:
    Dim I As Integer
    For I = 0 To List1.ListCount - 1
        Printer.Print List1.List(I)
    Next
    Printer.EndDoc

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Scarsdale, NY
    Posts
    26

    Post

    Thanks, Aaron!

    Worked like a charm!

    Olga.

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    Burlington, IA, USA`
    Posts
    77

    Post

    Option Explicit
    Dim i As Integer

    Private Sub cmdPrint_Click()
    For i = 0 To 9
    List1.ListIndex = i
    'Debug.Print List1 'Prints in the immediate window
    Print List1 'Prints on the form
    'Printer.Print List1 'Prints on my laser, Assume no more than one page
    Next
    Printer.EndDoc
    End Sub

    Private Sub Form_Load()
    For i = 1 To 10
    List1.AddItem (i)
    Next
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width