Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do I change the alignment of the data of table box and the header ?
sub test1234
Dim tb
Set tb= ActiveDocument.GetSheetObject("TB124")
set clus1 = ActiveDocument.Variables("Vbranch_Z")
clus = clus1.GetContent.String
tb.removeField(1)
tb.removeField(0)
tb.AddField "ORDER_KEY_" & clus
tb.AddField "Clus_input_" & clus
set tbp = tb.GetProperties
set cols = tbp.Layout.ColLayouts
cols.Item(0).Label.v = "Name"
cols.Item(1).Label.v = "ID"
tb.SetProperties tbp
End Sub
From the API Guide:
set mybox = ActiveDocument.ActiveSheet.CreateTableBox
mybox.AddField "Class"
mybox.AddField "ClassComment"
set tbp = mybox.GetProperties
tbp.Layout.HeaderMultiLine = 2
tbp.Layout.ColLayouts.Item(0).LabelVerticalAdjust = 4 'center
tbp.Layout.ColLayouts.Item(0).LabelAdjust = 1 'center
mybox.SetProperties tbp
From the API Guide:
set mybox = ActiveDocument.ActiveSheet.CreateTableBox
mybox.AddField "Class"
mybox.AddField "ClassComment"
set tbp = mybox.GetProperties
tbp.Layout.HeaderMultiLine = 2
tbp.Layout.ColLayouts.Item(0).LabelVerticalAdjust = 4 'center
tbp.Layout.ColLayouts.Item(0).LabelAdjust = 1 'center
mybox.SetProperties tbp
This code snippet is helpful in making the Label Center Justified. I want to make the data within these labels center justified,ike the numbers 1, 2,3(i. e. the data within the column ID center justified.And Also How do i increase the size of the table box from default.Could you please guide me on this.
set tbp = tb.GetProperties
set cols = tbp.Layout.ColLayouts
cols.Item(0).Label.v = " ID"
cols.Item(0).ColWidth = 500
cols.Item(0).LabelVerticalAdjust = 4
cols.Item(0).LabelAdjust = 1
cols.Item(0).NumAdjust = 1
cols.Item(1).Label.v = "Name"
cols.Item(1).ColWidth = 500
cols.Item(1).LabelVerticalAdjust = 4
cols.Item(1).LabelAdjust = 1
cols.Item(1).TextAdjust = 1
tb.SetProperties tbp
I could solve the problem by your suggestions .I used API Guide as well.