Private Sub Form_Load()
Dim lngReturn As Long
Dim typSize As Size
Dim lngX As Long
Dim lngY As Long
Dim strMyString As String
strMyString = "This is my string"
lngReturn = GetTextExtentPoint32(Me.hDC, strMyString, Len(strMyString), typSize)
With typSize
lngX = .cx * Screen.TwipsPerPixelX
lngY = .cy * Screen.TwipsPerPixelY
End With
MsgBox "X =" & lngX & " Y=" & lngY
End Sub