Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to change the properties of TableBox through macros. For example change the label of a column, Set "Omit Rows where Field is NULL" as checked for a field in presentation tab.
I was looking to in API Guide and I found following example under TableBox - SetProperties.
set tb = ActiveDocument.Sheets("Main").CreateTableBox
tb.AddField "Class"
tb.AddField "Member"
set tb = tb.GetProperties
tp.Layout.Frame.Name.v = "MyTable"
tb.SetProperties tp
I understand how to change the name of the table. How do I change other values, like field label, using this approach? Where can I find documentation for more property settings, etc.
Please help.
Hi Sallam,
Here's an example on how to create a tablebox with two fields, rename the labels and check the "Omit rows where field is NULL" for both fields.
sub TB
set mybox = ActiveDocument.ActiveSheet.CreateTableBox
mybox.AddField "Field1"
mybox.AddField "Field2"
set tbp = mybox.GetProperties
set cols = tbp.Layout.ColLayouts
for i = 0 to cols.Count-1
cols.Item(i).Label.v = "Column"&i+1
cols.Item(i).NullSuppression = true
next
mybox.SetProperties tbp
end sub
Hi Sallam,
Here's an example on how to create a tablebox with two fields, rename the labels and check the "Omit rows where field is NULL" for both fields.
sub TB
set mybox = ActiveDocument.ActiveSheet.CreateTableBox
mybox.AddField "Field1"
mybox.AddField "Field2"
set tbp = mybox.GetProperties
set cols = tbp.Layout.ColLayouts
for i = 0 to cols.Count-1
cols.Item(i).Label.v = "Column"&i+1
cols.Item(i).NullSuppression = true
next
mybox.SetProperties tbp
end sub
Hi Johannes,
Thanks for the help.
Satheesh