Results 1 to 3 of 3
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Get able Row Height (2000)

    Word also has a PointsToCentimeters function, at least Word 2002 VBA does. If that isn't available in Word 2000, you can create it yourself:

    Public Function PointsToCentimeters(Pts As Single) As Single
    PointsToCentimeters = Pts / 72 * 2.54
    End Function

    Since 72 points = 1 inch by definition, and 1 inch = 2,54 cm, you can convert from points to centimeters by dividing by 72, then multiplying with 2.54 (or you can divide by 72 / 2.54 = 28.35)

  2. #2
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get Table Row Height (2000)

    Hi, I have a macro that asks user for input and sets the current table height to the number input :

    Sub inputSize()
    Dim sSize As Single
    sSize = InputBox("Enter row size")
    If inTable = True And sSize > 0 Then
    Selection.Rows.HeightRule = wdRowHeightExactly
    Selection.Rows.Height = CentimetersToPoints(sSize)
    End If
    End Sub

    (inTable is a function to check that the current selection is within a table)

    is there a way of returning the current height of the row in centimetres rather than points, as when i do

    MsgBox Selection.Rows.Height

    i get it in points.
    Thanks,

    pmatz

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Get able Row Height (2000)

    Yes, it has that function. Thanks. I was trying to do

    Msgbox Selection.Rows.Height(PointsToCentimeters)

    but i got it now with

    Round(PointsToCentimeters(Selection.Rows.Height), 2)

    Cheers
    Thanks,

    pmatz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •