Is there a way of programatically opening a CSV file in Word so that it's in
table format, like it does in Excel? It's easy enough to write code to
convert it to a table after opeining it, but it's kind of a pain to have to
do it that way since some fields are separated simply with commas and others
with commas and double quote marks.

Signature
Bryan
Graham Mayor - 06 Jun 2007 13:42 GMT
Of course not. CSV is a plain text file. Plain text does not support tables.
You don't even need code to convert it to a table - select the text then
table > convert text to table. See
http://www.gmayor.com/convert_labels_into_mail_merge.htm and save as a Word
document.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Is there a way of programatically opening a CSV file in Word so that
> it's in table format, like it does in Excel? It's easy enough to
> write code to convert it to a table after opeining it, but it's kind
> of a pain to have to do it that way since some fields are separated
> simply with commas and others with commas and double quote marks.
Peter Jamieson - 07 Jun 2007 17:28 GMT
Use Word's database toolbar, or try the InsertDatabase method in VBA.
It doesn't always work with CSV files because of errors in WOrd, but worth a
try.
Peter Jamieson
> Is there a way of programatically opening a CSV file in Word so that it's
> in
[quoted text clipped - 4 lines]
> others
> with commas and double quote marks.