P
Paul Moloney
I've hacked together a macro that performs some formatting on autogenerated
DB reports.
The very first line takes every three lines in the current selection
(seperated by paragraph
marks) and turns them into a table row of three columns:
Selection.ConvertToTable Separator:=wdSeparateByParagraphs,
NumColumns:=3, _
AutoFitBehavior:=wdAutoFitFixed
This seems to work fine when there are no tabs in the line; for example:
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
correctly produces the table with 2 lines and 3 columns:
| Line 1 | Line 2 | Line 3 |
| Line 4 | Line 5 | Line 6 |
However on the lines (from the actual report):
1. XFR_ID
Physical data type:<tab>NUMBER(38,0)
Allow NULLs:<tab>Not allowed
I get a table with 3 lines and _1_ column.
I've tried to figure out what exactly is the problem.
The underscore in the first line doesn't seem to be the problem,
or the tabs, or the mix of spaces on the first line
and tabs in the others - I've used the macro successful
on test lines with such characteristics.
Does anyone have any ideas or a workaround?
Thanks,
P.
DB reports.
The very first line takes every three lines in the current selection
(seperated by paragraph
marks) and turns them into a table row of three columns:
Selection.ConvertToTable Separator:=wdSeparateByParagraphs,
NumColumns:=3, _
AutoFitBehavior:=wdAutoFitFixed
This seems to work fine when there are no tabs in the line; for example:
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
correctly produces the table with 2 lines and 3 columns:
| Line 1 | Line 2 | Line 3 |
| Line 4 | Line 5 | Line 6 |
However on the lines (from the actual report):
1. XFR_ID
Physical data type:<tab>NUMBER(38,0)
Allow NULLs:<tab>Not allowed
I get a table with 3 lines and _1_ column.
I've tried to figure out what exactly is the problem.
The underscore in the first line doesn't seem to be the problem,
or the tabs, or the mix of spaces on the first line
and tabs in the others - I've used the macro successful
on test lines with such characteristics.
Does anyone have any ideas or a workaround?
Thanks,
P.