CentimetersToPoints

C

Cresta

Hello
I'm creating a custom outline numbered list with the code below and am
struggling to find the correct references for the CentimetersToPoints. The
error checking tooltiptext returns "Name 'CentimetersToPoint' is not
declared."
Can anybody help?

Private applicationObject As Word.Application

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete

With
applicationObject.ListGalleries(Word.WdListGalleryType.wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = "%1"
.TrailingCharacter = Word.WdTrailingCharacter.wdTrailingTab
.NumberStyle = Word.WdListNumberStyle.wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(0)
.Alignment = Word.WdListLevelAlignment.wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(1.27)
.TabPosition = CentimetersToPoints(1.27)
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = 0
.Italic = 0
.StrikeThrough = 0
and so on........

Thankyou
 
J

Jonathan West

CentimetersToPoints is a method of the Application object in Word. In your
code below, you can replace CentimetersToPoints with
applicationObject.CentimetersToPoints.

But you can probably simplify things a bit more. 1.27 centimeters is half
and inch, or 36 points. So you can replace CentimetersToPoints(1.27) with
36. and replace CentimetersToPoints(0) with 0.
 
T

Tony Jollans

CentimetersToPoints is part of Word's object model, so you will need to
qualify it:

applicationObject.CentimetersToPoints
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top