borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how i print a tif file contain multi images insdie it)Next Topic (Printing On Labels) New Topic New Poll Post Reply
AndreaVB Forum : Printing : printing items selected from a list
Poster Message
Colin Evans
Level: Guest


icon printing items selected from a list

Hi

I want to present the user with a list of files, some Word, some BMP and some TIF files and then allow them to select all the items, one item, or multiple items and then print the selected files based on the user selection.

Whilst I can print the various files individually I'm not that aware of using a list box, I can populate the list and I can allow the user to click on the items, singularly or use Shift or Control + left click etc but where I actually go from here I'm not sure

Any idea's would be gratefully appreciated.

20-05-2003 at 02:21 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: printing items selected from a list

Hi there,

I think, I read from your post that the printing is not the issue, but selecting the item is. Please try the code below.


Private Sub Command1_Click()

    Dim i As Integer

    For i = 0 To List1.ListCount - 1
    
        If List1.Selected(i) = True Then
            
            MsgBox "Print this one :" & List1.List(i)
            
        End If
        
    Next i

End Sub




Cheers Steve  

[Edited by steve_w on 20-05-2003 at 03:17 PM GMT]

20-05-2003 at 03:16 PM
View Profile Send Email to User Show All Posts | Quote Reply
Colin Evans
Level: Guest

icon Re: printing items selected from a list

Hi
Many thanks for your reply which got me back on track, however it seems I still have the problem of printing, whilst I can print an image that is displaying on the screen I can't seem to figure out what the syntax is for printing a file.

Also do the various file formats all need different code dependant on the application, again any help greatly appreciates, the code as it stands so far is below;

Private Sub CmdPrint_Click()
    Dim i As Integer
    Dim Buffer$
    
   For i = 0 To List1.ListCount - 1
        Buffer = ""
        If List1.Selected(i) = True Then
            Buffer = List1.List(i)
            If Left$(Buffer, 1) <> "" Then
              Location = Left$(Buffer, InStr(Buffer, " --- ") - 1)
              Description = Mid$(Buffer, InStr(Buffer, " --- ") + 5)
              doctype = Mid$(Location, InStr(Location, ".") + 1, 3)
                End If
            If doctype = "doc" Then
                'print out the word document
            End If
            
            If doctype = "bmp" Then
                'print out the bitmapped file
            End If
            
            If doctype = "tif" Then
                'print out the tif file
            End If
            
        End If
   Next i
  
End Sub

21-05-2003 at 08:21 AM
| Quote Reply
AndreaVB Forum : Printing : printing items selected from a list
Previous Topic (how i print a tif file contain multi images insdie it)Next Topic (Printing On Labels) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder