Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
How do i only show the column headers from the excel file that I am mail
merging into word. So instead of it saying first_Name it says A without taking out the header names in the excel file. I'm trying to do it this way because some of the header names are so long it messes up the formatting in the word document when I need to print out the document with only the fields showing |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I don't know of a simple way to do it, assuming that the printed version
needs to match what the user will see. You can try connecting using Word VBA OpenDataSource and alias all the field names in the SQLStatement, but that statement has a maximum of either 255 or 511 characters and it will probably only take a few fields with long field names to exceed that limit - plus, you then have a data source that the user will probably not be able to filter or sort, or in WOrd 2007, edit the data from Word. e.g., you might have something like: Sub ConnectWithAliases() ActiveDocument.MailMerge.OpenDataSource _ Name:="C:\blah\myxls.xls", _ sqlstatement:="SELECT S.first_name AS `A`, S.last_name AS `B` FROM [Sheet1$] [S]" End Sub (Make sure the quotes around A and B are backquotes, i.e. `` , not straight quotes, i.e. '' -- Peter Jamieson http://tips.pjmsn.me.uk "sherobot" wrote in message ... How do i only show the column headers from the excel file that I am mail merging into word. So instead of it saying first_Name it says A without taking out the header names in the excel file. I'm trying to do it this way because some of the header names are so long it messes up the formatting in the word document when I need to print out the document with only the fields showing |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
hmm not sure I could use that because other people would need to work in the
file and don't know much excel. But the work around I found was to insert a column above row 1(the long descriptive headings) and type in A, B, C accordingly to match the alphabetized column headings. It just seems redundant to have to do this. Then when I merge the file I turn off row 2( the row with my descriptive headings) "Peter Jamieson" wrote: I don't know of a simple way to do it, assuming that the printed version needs to match what the user will see. You can try connecting using Word VBA OpenDataSource and alias all the field names in the SQLStatement, but that statement has a maximum of either 255 or 511 characters and it will probably only take a few fields with long field names to exceed that limit - plus, you then have a data source that the user will probably not be able to filter or sort, or in WOrd 2007, edit the data from Word. e.g., you might have something like: Sub ConnectWithAliases() ActiveDocument.MailMerge.OpenDataSource _ Name:="C:\blah\myxls.xls", _ sqlstatement:="SELECT S.first_name AS `A`, S.last_name AS `B` FROM [Sheet1$] [S]" End Sub (Make sure the quotes around A and B are backquotes, i.e. `` , not straight quotes, i.e. '' -- Peter Jamieson http://tips.pjmsn.me.uk "sherobot" wrote in message ... How do i only show the column headers from the excel file that I am mail merging into word. So instead of it saying first_Name it says A without taking out the header names in the excel file. I'm trying to do it this way because some of the header names are so long it messes up the formatting in the word document when I need to print out the document with only the fields showing |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can i use mail merge to change headers throughout many different . | Microsoft Word Help | |||
Mail Merge combines characters into one column | Mailmerge | |||
Using mail merge date fields in headers | Mailmerge | |||
Please help - Missing headers in mail merge | Mailmerge | |||
Excel Column Labels and mail merge | Mailmerge |