如何在vb6中将默认打印机更改为现有的物理打印机? [英] How I could change the default printer to an existing physical printer in vb6?

查看:105
本文介绍了如何在vb6中将默认打印机更改为现有的物理打印机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,

我想知道是否有人可以在以下方面为我提供帮助:

我的电脑中安装了打印机列表,其中一些是物理打印机.有些是虚拟的(例如SnagIT 9和Nitro PDF Creator).

i)是否可以通过VB6.0代码检查默认打印机是虚拟打印机还是物理打印机?

ii)如何找到安装在PC上的物理打印机,并通过VB6.0代码将其设置为默认打印机?

其背后的想法是让用VB6.0代码编写的应用程序根据运行时报表的需要更改默认打印机的"PaperSize"和"Orientation"属性.

任何帮助的尝试将不胜感激.
在此先谢谢您.

Greetings,

I wonder if someone can help me with the following:

I have a list of printers installed in my pc, some are physical & some are virtual (eg. SnagIT 9, & Nitro PDF Creator).

i) Is there a way to check if the default printer is virtual or physical through a VB6.0 code?

ii) How I can find a physical printer installed in my pc set it as default from a VB6.0 code?

The idea behind this is to let the application written in VB6.0 code to change the ''PaperSize'' and ''Orientation'' properties of the default printer as the report needs at runtime.

Any try to help will be appreciated a lot.
Thanks in advance.

推荐答案

要了解打印机是否是物理打印机,可以阅读WMI Win32_Printer.

该链接具有在vb6中执行此操作的代码:
http://www.vbforums.com/showthread.php?p=3870232 [ ^ ]

Win32_Printer的参考:
http://msdn.microsoft.com/en-us/library/aa394363%28v = vs.85%29.aspx [ ^ ]

以下数据成员可以为您提供有关您正在使用哪种打印机的信息:
-DeviceID
-本地
-位置
-标记技术
-网络
-PNPDeviceID

祝你好运!
To find out if a printer is physical you can read the WMI Win32_Printer.

This link has code to do that in vb6:
http://www.vbforums.com/showthread.php?p=3870232[^]

Reference of Win32_Printer:
http://msdn.microsoft.com/en-us/library/aa394363%28v=vs.85%29.aspx[^]

The following data members can give you info on what kind of printer you''re dealing with:
- DeviceID
- Local
- Location
- MarkingTechnology
- Network
- PNPDeviceID

Good luck!


非常感谢我的朋友...

但我认为这与我的情况无关...

我需要检查默认打印机是物理打印机还是虚拟打印机,如果是虚拟打印机,那么如何通过vb6.0将现有的物理打印机设置为默认打印机?

应该有一个接口,类,属性,方法或将返回指定打印机类型的东西,以便我可以用来实现我的客户请求.

如果您有我的想法,并且有什么可以帮助我的,我将不胜感激...

预先感谢....
Thanks a lot my friend...

But I think this has nothing to do with my case...

what I need is to check if the default printer is physical or virtual, and if it is a virtual one, then how I could set an existing physical printer as the default one through vb6.0?

There should be an interface, class, property, method, or something that will return the type of a specified printer so that I can use to implement my client request.

If you get my idea, and have something that could help me, I will be very appreciated...

Thanks in advance....


这篇关于如何在vb6中将默认打印机更改为现有的物理打印机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆