Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Rename a column
Hello,
I inserted a database field to my word doc with data from .csv file. Am I able to change the name of column to make the column header more meaningful? Test.doc = ..... { DATABASE \d "C:\\Temp\\Data.csv" \c "" \s "SELECT OrderItem_id, OrderItem_price FROM C:\\Temp\\Data.csv" \l "3" \b "191" \h } As you know, Word will display above as a table with 2 columns, "OrderItem_id" and "OrderItem_price" for the column header. Is there a way I can change the column header's text to something else? I tried to change the select statement to become ".... SELECT OrderItem_Id as ID...." but it didn't work either. Please help. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Rename a column
You will need to change the names of the fields in the .csv file.
-- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP wrote in message oups.com... Hello, I inserted a database field to my word doc with data from .csv file. Am I able to change the name of column to make the column header more meaningful? Test.doc = ..... { DATABASE \d "C:\\Temp\\Data.csv" \c "" \s "SELECT OrderItem_id, OrderItem_price FROM C:\\Temp\\Data.csv" \l "3" \b "191" \h } As you know, Word will display above as a table with 2 columns, "OrderItem_id" and "OrderItem_price" for the column header. Is there a way I can change the column header's text to something else? I tried to change the select statement to become ".... SELECT OrderItem_Id as ID...." but it didn't work either. Please help. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Rename a column
For a .csv file in Word 2003 (and possibly Word 2002, you can try this:
Create a file in c:\\temp called t.udl, e.g. using Notepad. It doesn't have to have anything in it. Use the following DATABASE field: { DATABASE \d "C:\\Temp\\t.udl" \c "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\;Mode=Share Deny None;Extended Properties=\"HDR=YES;\";Jet OLEDB:Engine Type=96;" \s "SELECT OrderItem_id as ID, OrderItem_price FROM Data.csv" \l "3" \b "191" \h } If you have spaces in your alias name (e.g. "Item ID") or file name , quote the name using backquotes `` or square brackets [ ] but not straight quotes '' or \"\". e.g. { DATABASE \d "C:\\Temp\\t.udl" \c "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\;Mode=Share Deny None;Extended Properties=\"HDR=YES;\";Jet OLEDB:Engine Type=96;" \s "SELECT OrderItem_id as [item ID], OrderItem_price FROM Data.csv" \l "3" \b "191" \h } Peter Jamieson wrote in message oups.com... Hello, I inserted a database field to my word doc with data from .csv file. Am I able to change the name of column to make the column header more meaningful? Test.doc = ..... { DATABASE \d "C:\\Temp\\Data.csv" \c "" \s "SELECT OrderItem_id, OrderItem_price FROM C:\\Temp\\Data.csv" \l "3" \b "191" \h } As you know, Word will display above as a table with 2 columns, "OrderItem_id" and "OrderItem_price" for the column header. Is there a way I can change the column header's text to something else? I tried to change the select statement to become ".... SELECT OrderItem_Id as ID...." but it didn't work either. Please help. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting a Full Width Table in a 2 Column Document | Page Layout | |||
table column width problems | Tables | |||
formatted paragraph shading top of 2nd column appears bottom 1st c | Microsoft Word Help | |||
Dragging table column resets | Tables | |||
Not your average Word column question - help! | Microsoft Word Help |