Table (1)
|–a--|----b-----|
|–c--|–d--|–e--|
|–f--|–g--|–h--|
I’m having problems constructing a table similar to Table (1). What I’m doing now is:
'Main Loop
'Section Loop
'(for cells a,b)
Builder.InsertCell
Builder.Write Section 'I, II, III…
Builder.InsertCell
Builder.InsertCell '***these two should be merged
Builder.InsertCell '***these two should be merged
Builder.CellFormat.HorizontalMerge = 2
Builder.Write “Section Header” 'should be written in the merged field
Builder.EndRow
'Sub-Items Loop
'(for cells c-h)
Builder.InsertCell
Builder.InsertCell
Builder.Write Subitem 'A, B, C…
Builder.InsertCell
Builder.Write “This is a child node of the section header”
Builder.EndRow
'End SubItems Loop
'End Section Loop
Builder.InsertCell
Builder.InsertCell
Builder.InsertCell
Builder.EndRow
'End Main Loop
When I execute this, the created document had very messed up tables.
What should display when done correctly is:
|----I.—|-----------------------1st Section Header--------------------------|
|---------|—A.—|---This is the 1st child node of the section header-----|
|---------|—B.—|---This is the 2nd child node of the section header—|
|---------|—C.—|---This is the 3rd child node of the section header----|
|---------|---------|-------------------------------------------------------------|
|----II.–|-----------------------2nd Section Header-------------------------|
|---------|—A.—|---This is the 1st child node of the section header-----|
|---------|—B.—|---This is the 2nd child node of the section header—|
|---------|—C.—|---This is the 3rd child node of the section header----|
…
I’m guessing that the error is somewhere in my (for rows a,b) code. Am I using the horizontal merge function correctly?