How can I list properties by VBA?

S

Simon Kearns

Hi,
What would be the method to do this:

For each aProperty in myDocument.myTable
debug.print aProperty
next aProperty

-- In this instance a table but need to apply to any word object.

I want to be able to see a list of all the properties of a table so I have
the chance of setting their values in code. I have tried recording a macro
of mouse clicking the table properties dislog box but the macro only seems
to return the items that I change.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 16/02/05 by SK
'
Selection.Tables(1).Select
Selection.Cells.SetHeight RowHeight:=12, HeightRule:=wdRowHeightExactly
With Selection.Rows
.Alignment = wdAlignRowLeft
.AllowBreakAcrossPages = True
.SetLeftIndent LeftIndent:=CentimetersToPoints(0.5), RulerStyle:= _
wdAdjustNone
End With
Selection.Cells.AutoFit
End Sub

Thanks
 
J

Jezebel

Microsoft seem to have waxed hot and cold on this issue. Some MS objects (eg
in the DAO library) have a Properties property that does exactly what you
describe. Unfortunately, most -- including those in Word -- do not. You can
view the properties using the Object Browser, but there's no built-in method
for iteration.
 
S

Simon Kearns

Thanks. That is pretty sad. I thought after I posted that what I really want
of course is to get property.value but I don't suppose that makes any
difference?
 

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