Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am trying to create a table box automatically using a macro.
I have a list of fields already and I want to add these fields to the table box through a macro. As suggested in the API guide, it is not possible to manually add all the fields using addfield "Class" etc. Please suggest me a way for this.
Cheers,
Naresh
Got this and it works fine
set mybox = ActiveDocument.GetSheetObject("M001")
MB = mybox.GetProperties
MB.Layout.Frame.Name.v=ActiveDocument.Variables("Variable1").GetContent.String
mybox.SetProperties MB
set MB = ActiveDocument.GetSheetObject("MB001")
For i = 0 to MB.GetRowcount - 1
MB.RemoveField 0
next
For i = 0 to GeoLabel.count - 1
MB.AddField GeoSelection.Item(i).text
mbp = MB.GetProperties
mbp.MemberAttributes.Item(i).Label.v = FieldLabel.item(i).text
MB.SetProperties mbp
Next
Got this and it works fine
set mybox = ActiveDocument.GetSheetObject("M001")
MB = mybox.GetProperties
MB.Layout.Frame.Name.v=ActiveDocument.Variables("Variable1").GetContent.String
mybox.SetProperties MB
set MB = ActiveDocument.GetSheetObject("MB001")
For i = 0 to MB.GetRowcount - 1
MB.RemoveField 0
next
For i = 0 to GeoLabel.count - 1
MB.AddField GeoSelection.Item(i).text
mbp = MB.GetProperties
mbp.MemberAttributes.Item(i).Label.v = FieldLabel.item(i).text
MB.SetProperties mbp
Next