Application.PointsToCentimeters 方法 (Publisher)

将度量值从 转换为厘米, (1 cm = 28.35 磅) 。 转换后的度量单位以 Single 类型返回。

语法

表达式PointsToCentimeters (Value)

expression:表示 Application 对象的变量。

参数

名称 必需/可选 数据类型 说明
必需 Single 要转换为厘米值的磅值。

返回值

单精度

备注

使用 CentimetersToPoints 方法可将度量单位从厘米转换为磅。

示例

以下示例将用户以磅输入的度量值转换为厘米值。

Dim strInput As String 
Dim strOutput As String 
 
Do While True 
 ' Get input from user. 
 strInput = InputBox( _ 
 Prompt:="Enter measurement in points (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) & " points = " _ 
 & Format(Application _ 
 .PointsToCentimeters(Value:=Val(strInput)), _ 
 "0.00") & " cm" 
 
 MsgBox strOutput 
Loop

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。