保留/重复使用打印机设置作为用户定义 [英] Preserve/reuse printer settings as user definitions

查看:113
本文介绍了保留/重复使用打印机设置作为用户定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我决定尝试一下,问一下。答案可能没有真实的例子或代码,更像是逻辑或设计理念。

Well, I decided to give it try and ask here. Answers can be without real examples or code, more like logical or design ideas.

我需要做的是保留用户通过Access 2010中的界面定义的打印机设置,然后重新使用这些使用未预览的自动打印任务,但是通过为组织中的各种打印机准备的代码(应用各种设置
,从托盘,副本等)。

What I need to do is to preserve printer settings user defines through interface in Access 2010 and then re-use these with automated printing tasks which are not previewed, but via code prepared for various printers in organization (with various settings applied, from trays, copies etc).

问题是什么是保存/保存这些设置的最佳方法吗?在仍然在Acc97上运行的旧应用程序中,最安全的解决方案是创建具有特殊命名约定的小型隐形窗体,它将使用它们保存打印机设置,并且只需
通过在打印过程中复制prtDevMode结构来重用它们。这是非常安全的,因为Access会在内部注意创建的打印设置是应该的,并且用户将通过内部的PageSetup对话框创建它,所以非常好。在
探索了新版Access的所有可能性之后,我仍然找到了这个最佳解决方案(请注意用户可以使用各种操作系统,从XP,x32 Windows,x64 Windows等,它们之间有足够的不兼容性放弃使用API​​设置DEVMODE结构的
的想法,并可能以其他方式保留设置。)

The question is what would be the best way to preserve/save these settings? In old app that was still running on Acc97 safest solution was to create small invisible forms with special naming convention, which will hold printer settings with them and simply reuse them by copying prtDevMode structure during print process. This was quite safe, because Access would internally take care that created print setting is as it should be and user would create it through internal PageSetup dialog, so all very nice. After exploring long and wide all the possibilities with new versions of Access, I still find this optimum solution (please note user can be on various OS, from XP, x32 Windows, x64 Windows etc and there is enough incompatibility between them to abandon the idea of using API to set DEVMODE structures and maybe preserve settings some other way).

这个用小隐藏形式保存用户打印机设置的选项被证明是最安全的选择,但我偶然发现了一个迫使我重新思考的问题。也就是说,新的Access不再支持用户级别的安全性,因此(并且不仅如此)未来前面的
结尾将作为.accde发布,此处显示明显的问题,即表单无法创建.accde 

This option of saving user printer settings with small hidden forms proved safest bet, but I stumbled on a issue forcing me to rethink. Namely, new Access does not support user level security any more and because of that (and not only that) future front ends will be released as .accde, with obvious problem showing here, which is forms can not be created in .accde 

那么,什么是"理想"的呢?容器保留自定义用户打印机设置? (可以有许多,有时数十个,用户被给予界面来定义这样的打印方案并将它们保存在所需的名称下,以便与各种直接打印输出重复使用)。
保存打印机对象属性的集合不是解决方案,因为对象中不包含许多打印机选项,否则这将是一个很好的选项,它可以保存在简单的表中,链接数据库中。

So, what would be the "ideal" container to preserve custom user printer settings? (there can be many, sometimes dozens of those, user is given interface to define such print scenarios and save them under desired name, to be reused with various direct print-outs). Saving collection of Printer object properties is not a solution because there are many printer options not included with the object, otherwise this would be a great option, it could be saved in simple table, in a linked database.

简而言之,我需要找到更优雅的解决方案并保存这些自定义设置,欢迎所有关于如何解决问题的建议,注意API / DEVMODE现在已经出来了,它可能会保留这个方式。 

In short, I need to find more elegant solution with saving those custom settings, all suggestions on how to tackle the issue welcomed, with note that API/DEVMODE is for now out and it will likely stay this way. 

提前Thx,Miroslav

Thx in advance, Miroslav

推荐答案

我会考虑将prtDevMode属性保存到数据库表中。如果您已经有"保存"的解决方案将它们保存到隐藏的表单中,您也可以将它们保存到表格中,然后从该表格中读取它们并将它们设置为单个预先创建的隐藏
表格。

I would consider saving the prtDevMode property to a database table. If you already have a solution to "save" them to a hidden form, you can also save them to a table, and later read them back from that table and set them to a single pre-created hidden form.

我不确定我同意你放弃使用Windows API来设置DEVMODE结构的想法。您只需要考虑两组API声明(32位和64位),并且应该为Win95执行此操作。

I'm not sure I agree with you about abandoning the idea of using Windows APIs to set DEVMODE structures. You only have to consider two sets of API declarations (32-bit and 64-bit) and that should do it for Win95 to today.


这篇关于保留/重复使用打印机设置作为用户定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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