Results 1 to 11 of 11

Thread: Printer Preferences

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Printer Preferences

    Anyone know how to open printer preferences ?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Printer Preferences

    Use the commondialog control and call the .ShowPrinter method.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Printer Preferences

    I am not using common dialog. I able to display the printer devices in the combo box. Let say, I choose the printer A from combo box. How to show its printer preferences?I want to print as grayscale

    Code:
    'Add all the available printers to the combo box
            Combo7.Clear
            For i% = 0 To Printers.Count - 1
            
            Combo7.AddItem Printers(i%).DeviceName
            
            
            Next i%
           
           
           
           'Display the default printer
            For i% = 0 To Combo7.ListCount - 1
            If Combo7.List(i%) = Printer.DeviceName Then
            Combo7.ListIndex = i%
            Exit For
            End If
            Next i%

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Printer Preferences

    This will set grayscale.

    Code:
    Printer.ColorMode = vbPRCMMonochrome
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Printer Preferences

    How to used default colourmode with black and colour.


    Code:
              Dim p As Printer
              For Each p In Printers
    
              If p.DeviceName = Text9.Text And Option1.Value = False Then 'If grayscale colour not set
              
              Set Printer = p:
              Exit For
              
              ElseIf p.DeviceName = Text9.Text And Option1.Value = True Then 'If grayscale colour is set
              p.ColorMode = vbPRCMMonochrome
              Set Printer = p:
              
              Exit For
              End If
              
              Next

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Printer Preferences

    Use vbPRCMColor to specify color mode.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Printer Preferences

    Why This doesnt work?

    It always show this when I choose the print from combo. "Debug.Print p.DeviceName & " colormode is MONOCHROME" .

    Why it not print this message "p.DeviceName & " colormode is COLOR""



    Code:
    Private Sub Command1_Click()
    
    
             Dim p As Printer
             For Each p In Printers
             If p.DeviceName = Combo1.Text And p.ColorMode = vbPRCMColor Then
             Set Printer = p:
             MsgBox "HI"
             Debug.Print p.DeviceName & " colormode is COLOR"
             Printer.EndDoc
             Exit For
             ElseIf p.DeviceName = Combo1.Text And p.ColorMode = vbPRCMMonochrome Then
             Set Printer = p:
             Debug.Print p.DeviceName & " colormode is MONOCHROME"
             Printer.EndDoc
             Exit For
             
             End If
             Next
    End Sub

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Printer Preferences

    Does your printer support color mode? Are you trying to set the color mode of a virtual printer like the MS Office Document Image Writter?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Printer Preferences

    How I know the whether my printer support color mode or not?I have set the printer properties as color,why when I choose that printer it not print the message like this "Debug.Print p.DeviceName & " colormode is COLOR"
    "?My printer can print a color when I print from Microsoft Word.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Printer Preferences

    I have set the option true. Why it print the paper with color?


    Code:
              Dim p As Printer
              For Each p In Printers
              If p.DeviceName = Text9.Text And Option1.Value = False Then 'If grayscale not set
              Printer.ColorMode = vbPRCMColor
    
              Set Printer = p:
              Exit For
              
              ElseIf p.DeviceName = Text9.Text And Option1.Value = True Then 'If grayscale is set
              Printer.ColorMode = vbPRCMMonochrome
              Set Printer = p:
              
              Exit For
              End If
              
              Next

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Printer Preferences

    Maybe your not typeing in the correct DeviceName so it wont match?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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