Share via


Application.CentimetersToPoints Method

Publisher Developer Reference

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

Syntax

expression.CentimetersToPoints(Value)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Value Required Single The centimeter value to be converted to points.

Return Value
Single

Remarks

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

Example

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

Visual Basic for Applications
  Dim strInput As String
Dim strOutput As String

Do While True ' Get input from user. strInput = InputBox( _ Prompt:="Enter measurement in centimeters (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) & " cm = " _
    & Format(Application _
    .<strong class="bterm">CentimetersToPoints</strong>(Value:=Val(strInput)), _
    "0.00") &amp; " points"

MsgBox strOutput

Loop

See Also