Share via


PointsToCentimeters Method [Publisher 2003 VBA Language Reference]

Converts a measurement from points to centimeters (1 cm = 28.35 points). Returns the converted measurement as a Single.

expression.PointsToCentimeters(Value)

expression Required. An expression that returns one of the objects in the Applies To list.

Value  Required Single. The point value to be converted to centimeters.

Remarks

Use the CentimetersToPoints method to convert measurements in centimeters to points.

Example

This example converts measurements in points entered by the user to measurements in centimeters.

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

Applies to | Application Object