Results 1 to 4 of 4

Thread: Print doesn't print

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Mexico
    Posts
    12

    Question Print doesn't print

    I'm developing an app using Visual Basic 6.0; i used the VB app wizard to get started. I added a print button and it works just fine: it shows the print dialog when clicked.. the bad thing is that when i actually click print in the dialog, the dialog just closes but no document is printed... ¿what's wrong with the code?

    Her's the genereted code:


    Private Sub mnuArchivoImprimir_Click()
    On Error Resume Next
    If ActiveForm Is Nothing Then Exit Sub

    With dlgCommonDialog
    .DialogTitle = "Print"
    .CancelError = True
    .Flags = cdlPDReturnDC + cdlPDNoPageNums
    If ActiveForm.rtfText.SelLength = 0 Then
    .Flags = .Flags + cdlPDAllPages
    Else
    .Flags = .Flags + cdlPDSelection
    End If
    .ShowPrinter
    If Err <> MSComDlg.cdlCancel Then
    ActiveForm.rtfText.SelPrint .hDC
    End If
    End With

    End Sub


    Also, how can i format the form so it is able to print in Letter size pages?

    Thanks! and please help this newbie!

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    Is it just me or don't you actually tell it to print??

    You have .ShowPrinter but no .Print

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Mexico
    Posts
    12
    Originally posted by lintz
    Is it just me or don't you actually tell it to print??

    You have .ShowPrinter but no .Print
    Oops!.. missed that, anyway, it still doesn't print.. i get "Member or data not found" while compiling.. so.. í'm pretty sure it must be some other littel thing .. but, i don't know it.

    Any other idea? Thanks anyway!

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697
    when you get the error compling your project work with the code that is highlighted.

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