Problems with ConvertToTable

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.
 
W

Word Heretic

G'day "Paul Moloney" <[email protected]>,

Guess: try removing the autofit parm and then autoftting the table
next step.


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Paul Moloney reckoned:
 
P

Paul Moloney

Word Heretic said:
G'day "Paul Moloney" <[email protected]>,
Guess: try removing the autofit parm and then autoftting the table
next step.

Thanks! Actually, I ended up just removing
the leading number (since it wasn't required in
the output) from the first line (in Word,
replace "^#. " with ""), and _then_ the formatting
worked fine as well. Would appear to be a minor
bug.

Cheers,

P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top