open CSV file in table format in Word

M

muyBN

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

Graham Mayor

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.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Peter Jamieson

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
 

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