Table of contents
TOC
折叠目录
展开目录

Form.UseDefaultPrinter 属性 (访问)Form.UseDefaultPrinter Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回或设置一个boolean 类型的值,该值指示指定的窗体是否使用默认打印机系统;如此如果窗体或报表使用默认打印机。读/写。Returns or sets a Boolean indicating whether the specified form uses the default printer for the system; True if the form or report uses the default printer. Read/write.

语法Syntax

表达式UseDefaultPrinterexpression. UseDefaultPrinter

表达式_一个表示窗体对象的变量。_expression A variable that represents a Form object.

注解Remarks

此属性在“设计”视图中可读/写,但在所有其他视图中为只读。This property is read/write in Design view and read-only in all other views.

当此属性为True时,窗体或报表将默认打印机的设置继承其所有打印机设置。更改与将其打印机属性分配给打印机对象的窗体或报表的打印机将UseDefaultPrinter属性设置为FalseWhen this property is True, the form or report inherits all of its printer settings from the settings of the default printer. Changing the printer associated with a form or report by assigning its Printer property to a Printer object sets the UseDefaultPrinter property to False.

示例Example

下面的示例用于检查是否指定窗体使用默认打印机;如果不是默认打印机,则询问用户是否应使用默认打印机。The following example checks to see if the specified form is using the default printer; if not, the user is asked if it should.

Function CheckPrinter(frmTemp As Form) As Boolean 

 If frmTemp.UseDefaultPrinter = False Then 
 If MsgBox("Should this form use " _ 
 &; "the default printer?", _ 
 vbYesNo) = vbYes Then 
 frmTemp.UseDefaultPrinter = True 
 End If 
 End If 

End Function

另请参阅See also

概念Concepts

窗体对象Form Object

© 2018 Microsoft