CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Posts
    2

    VBA Printer change

    I have seen some techniques for changing the default printer in visual basic. But how do you do this in Access Basic, where there is no printer object?

    mindless in middletown


  2. #2
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    Re: VBA Printer change

    I don't know if it's what you're looking for but that code makes you open the file menu in the menu bar and opens the printer box and after that well it's as usual.


    Private Sub ImageImprimante_Click()
    On Error GoTo Err_ImageImprimante_Click

    DoCmd.DoMenuItem acFormBar, acrecordmenu, acSaveRecord, , acMenuVer70
    Dim stDocName As String, Critere As Variant

    Critere = Me![No_Appel]
    stDocName = "E_NoAppel"
    DoCmd.OpenReport stDocName, acViewPreview, [No_Appel], "[No_Appel] = " & Critere

    'the next line is the one that opens the
    'file menu to open the printer box the number 6
    'is the row order for the printer in the file menu
    DoCmd.DoMenuItem acFormBar, acFile, 6

    Exit_ImageImprimante_Click:
    Exit Sub

    Err_ImageImprimante_Click:
    MsgBox Err.Description
    Resume Exit_ImageImprimante_Click

    End Sub

    hope this works and that's what you were looking for


    nath

  3. #3
    Join Date
    Jan 2000
    Posts
    2

    Re: VBA Printer change

    merci pour la reponse!

    I ended up solving the problem using a WriteProfileString to change the default printer in the Win.ini

    Thanks again!


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

Featured