S
Sam
Hi all
I'm having a bit of trouble with CentimetersToPoints and PointsToCentimeters.
I'm saving settings to ListTemplates and then reading the settings. The
settings save CentimetersToPoints just fine, but when I read them back
PointsToCentimeters they're not the same. For instance, if I save something
as CentimetersToPoints(1.25) the PointsToCentimeters conversion will come
back as 1.250597.
When I save InchesToPoints I get back the same setting in PointsToInches (ie
saving .NumberPosition = InchesToPoints(1.25) returns
PointsToInches(.NumberPosition) = 1.25).
We can't use inches because we're metric.
Anybody have any ideas on how to make sure that when I save something metric
as 1.25 I'll get it back as 1.25 (or whatever)? Thanks for any advice...
Here's some code to demonstrate the problem:
Sub SetupLT()
Dim lstListTemplate As ListTemplate
Dim blnLTExists As Boolean
blnLTExists = False
For Each lstListTemplate In ActiveDocument.ListTemplates
If lstListTemplate.Name = "MyLT" Then
blnLTExists = True
Exit For
End If
Next lstListTemplate
If blnLTExists = False Then
Set lstListTemplate = ActiveDocument.ListTemplates.Add _
(OutlineNumbered:=True, Name:="MyLT")
ElseIf blnLTExists = True Then
Set lstListTemplate = ActiveDocument.ListTemplates("MyLT")
End If
With lstListTemplate.ListLevels(1)
.NumberPosition = CentimetersToPoints(1.25)
.TextPosition = CentimetersToPoints(2.5)
End With
End Sub
Sub ReadLT()
Set lstListTemplate = ActiveDocument.ListTemplates("MyLT")
With lstListTemplate.ListLevels(1)
MsgBox PointsToCentimeters(.NumberPosition)
MsgBox PointsToCentimeters(.TextPosition)
End With
End Sub
I'm having a bit of trouble with CentimetersToPoints and PointsToCentimeters.
I'm saving settings to ListTemplates and then reading the settings. The
settings save CentimetersToPoints just fine, but when I read them back
PointsToCentimeters they're not the same. For instance, if I save something
as CentimetersToPoints(1.25) the PointsToCentimeters conversion will come
back as 1.250597.
When I save InchesToPoints I get back the same setting in PointsToInches (ie
saving .NumberPosition = InchesToPoints(1.25) returns
PointsToInches(.NumberPosition) = 1.25).
We can't use inches because we're metric.
Anybody have any ideas on how to make sure that when I save something metric
as 1.25 I'll get it back as 1.25 (or whatever)? Thanks for any advice...
Here's some code to demonstrate the problem:
Sub SetupLT()
Dim lstListTemplate As ListTemplate
Dim blnLTExists As Boolean
blnLTExists = False
For Each lstListTemplate In ActiveDocument.ListTemplates
If lstListTemplate.Name = "MyLT" Then
blnLTExists = True
Exit For
End If
Next lstListTemplate
If blnLTExists = False Then
Set lstListTemplate = ActiveDocument.ListTemplates.Add _
(OutlineNumbered:=True, Name:="MyLT")
ElseIf blnLTExists = True Then
Set lstListTemplate = ActiveDocument.ListTemplates("MyLT")
End If
With lstListTemplate.ListLevels(1)
.NumberPosition = CentimetersToPoints(1.25)
.TextPosition = CentimetersToPoints(2.5)
End With
End Sub
Sub ReadLT()
Set lstListTemplate = ActiveDocument.ListTemplates("MyLT")
With lstListTemplate.ListLevels(1)
MsgBox PointsToCentimeters(.NumberPosition)
MsgBox PointsToCentimeters(.TextPosition)
End With
End Sub