MillimetersToPoints 方法 (Publisher)Application.MillimetersToPoints method (Publisher)

将度量单位从毫米转换为(1 毫米 = 2.835 磅)。Converts a measurement from millimeters to points (1 mm = 2.835 points). 转换后的度量单位以 Single 类型返回。Returns the converted measurement as a Single.

语法Syntax

表达式MillimetersToPoints()expression.MillimetersToPoints (Value)

expression:表示 Application 对象的变量。expression A variable that represents an Application object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
ValueValue 必需Required SingleSingle 要转换为磅值的毫米值。The millimeter value to be converted to points.

返回值Return value

单精度Single

备注Remarks

使用 PointsToMillimeters 方法可将度量单位从磅转换为毫米。Use the PointsToMillimeters method to convert measurements in points to millimeters.

示例Example

以下示例将用户以毫米输入的度量值转换为磅值。This example converts measurements in millimeters entered by the user to measurements in points.

Dim strInput As String 
Dim strOutput As String 
 
Do While True 
 ' Get input from user. 
 strInput = InputBox( _ 
 Prompt:="Enter measurement in millimeters (0 to cancel): ", _ 
 Default:="0") 
 
 ' Exit the loop if user enters zero. 
 If Val(strInput) = 0 Then Exit Do 
 
 ' Evaluate and display result. 
 strOutput = Trim(strInput) & " mm = " _ 
 & Format(Application _ 
 .MillimetersToPoints(Value:=Val(strInput)), _ 
 "0.00") & " points" 
 
 MsgBox strOutput 
Loop

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.