Results 1 to 2 of 2

Printing from a UserForm ListBox

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Printing from a UserForm ListBox

    Okay, I've done some work to solve the minor problems but the PRINTING is still an issue.
    There has to be a way to do this with SHELL API AUTOMATION or something!

    I have a macro that creates a ListBox1 in a UserForm called SelectToPrint

    my code runs thru the selected items in the Listbox and converts them to their associated filepath

    Example ListBox1 contains
    Picture7
    Picture12
    Picture90
    Picture45
    Picture5

    If the User Selects Entries Picture12 & Picture45 & Clicks the Print Command Button
    The macro will generate the following File Locations:
    C:\Files\Picture12.tif
    C:\Files\Picture45.tif
    Private Sub PRINTBUTTON1_Click()
    
    Dim RefNum As String
    Dim Files As String
    Dim i As Integer
    
    RefNum = InputBox("What is the Reference Number?")
        
    Files = ""
        
        For i = 0 To ListBox1.ListCount - 1
            If ListBox1.Selected(i) Then
                Files = Files & "C:\Files\" & ListBox1.List(i) & ".tif" & vbNewLine
            End If
        Next i
        
        Msg = Files
        MsgBox Msg
            
    Unload SelectToPrint
    
    End Sub
    My code then takes the filepaths and pops them into a message box (since I can't figure out what else to do with them!

    I want to replace this message box with a command to sends these two files to a Default Printer, Shrunk to Fit. (no Print Previewing!)

    The Reference Number returned from the InputBox needs to be in the Header on the printed page.

    TIA
    Last edited by carsto; 02-22-2007 at 11:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1