Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hi - I'm trying to apply a sort to a mailmerge field so that it automatically
sorts when the data is imported from a csv file. The field contains part numbers (it can be anywhere from 1 to about 70 part numbers) and unfortunately the product that creates the the csv does not have the capability to sort on this particular field and I need them sorted ascending for the process I am building. Would anyone be able to let me know if this is possible, and maybe point me in the right direction as to how I can accomplish this (code tips would be much appreciated). Thanks in advance - and please let me know if you need more details. Jon |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Open the csv file in Excel, sort it and save the sorted file to use as the
data source. "jonnyb" wrote: Hi - I'm trying to apply a sort to a mailmerge field so that it automatically sorts when the data is imported from a csv file. The field contains part numbers (it can be anywhere from 1 to about 70 part numbers) and unfortunately the product that creates the the csv does not have the capability to sort on this particular field and I need them sorted ascending for the process I am building. Would anyone be able to let me know if this is possible, and maybe point me in the right direction as to how I can accomplish this (code tips would be much appreciated). Thanks in advance - and please let me know if you need more details. Jon |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Thanks for the reply, but I guess I need to clarify - the csv file contains a
record for each transaction. In each record, there's a column that contains part numbers for all of the items that were requested in the transaction. All of these part numbers are contained in one cell of the record. I need to sort the part numbers in each cell independently and each cell can contain from 1 to 70 part numbers. The solution provided would work if each record had a part number and I wanted to sort all the records based on the part numbers, but unfortunately, that's not the task that I need to accomplish. "Doug Robbins - Word MVP" wrote: Open the csv file in Excel, sort it and save the sorted file to use as the data source. |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
A csv file must mean something different to you than it does to me (and I
think most other people). For starters, it does not contain cells. A CSV (comma-separated values) file contains the values in a table as a series of ASCII text lines organized so that each column value is separated by a comma from the next column's value and each record starts a new line. Provide an example of the data in the file and we can probably tell you how to go about it. -- 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 "jonnyb" wrote in message ... Thanks for the reply, but I guess I need to clarify - the csv file contains a record for each transaction. In each record, there's a column that contains part numbers for all of the items that were requested in the transaction. All of these part numbers are contained in one cell of the record. I need to sort the part numbers in each cell independently and each cell can contain from 1 to 70 part numbers. The solution provided would work if each record had a part number and I wanted to sort all the records based on the part numbers, but unfortunately, that's not the task that I need to accomplish. "Doug Robbins - Word MVP" wrote: Open the csv file in Excel, sort it and save the sorted file to use as the data source. |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Doug - thanks again for the response.
A CSV file means the same thing to me as it does to the rest of world, and you are correct that I don't actually have "cells", but I thought that using the "cell" analogy would help explain the task at hand. Here's an example of what I'm talking about (in csv format): CSV format: Order_ID, Customer_Name, Part_Numbers Sample Data for above format: "1001", "John Smith", "001" "010" "007" "1002", "Jill Jones", "031" "002" "1003", "Bill Williams", "014" "002" "001" I need to sort the third value (Part_Numbers) so that they appear in ascending order on my mailmerge document. It would be great if the data could come to me with either one Part_Number per record (with multiple records for each order) or with each Part_Number seperated by commas, but the client is not willing to change this feed (I guess it's used to feed other programs so they do not want to change anythng for risk of breaking something else that uses the feed). Any ideas? I'm actually thinking about just telling the client that they're out of luck unless they presort the Part_Numbers during the build of the csv file. Jon "Doug Robbins - Word MVP" wrote: A csv file must mean something different to you than it does to me (and I think most other people). For starters, it does not contain cells. A CSV (comma-separated values) file contains the values in a table as a series of ASCII text lines organized so that each column value is separated by a comma from the next column's value and each record starts a new line. Provide an example of the data in the file and we can probably tell you how to go about it. -- 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 |
#6
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
If you want to send me a typical csv file, I can easily produce a macro that
will achieve what you want. -- 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 "jonnyb" wrote in message ... Doug - thanks again for the response. A CSV file means the same thing to me as it does to the rest of world, and you are correct that I don't actually have "cells", but I thought that using the "cell" analogy would help explain the task at hand. Here's an example of what I'm talking about (in csv format): CSV format: Order_ID, Customer_Name, Part_Numbers Sample Data for above format: "1001", "John Smith", "001" "010" "007" "1002", "Jill Jones", "031" "002" "1003", "Bill Williams", "014" "002" "001" I need to sort the third value (Part_Numbers) so that they appear in ascending order on my mailmerge document. It would be great if the data could come to me with either one Part_Number per record (with multiple records for each order) or with each Part_Number seperated by commas, but the client is not willing to change this feed (I guess it's used to feed other programs so they do not want to change anythng for risk of breaking something else that uses the feed). Any ideas? I'm actually thinking about just telling the client that they're out of luck unless they presort the Part_Numbers during the build of the csv file. Jon "Doug Robbins - Word MVP" wrote: A csv file must mean something different to you than it does to me (and I think most other people). For starters, it does not contain cells. A CSV (comma-separated values) file contains the values in a table as a series of ASCII text lines organized so that each column value is separated by a comma from the next column's value and each record starts a new line. Provide an example of the data in the file and we can probably tell you how to go about it. -- 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can Word display full path of a file in the title bar? | Microsoft Word Help | |||
Does Word have a QuickCorrect/Quick Word option like WordPerfect? | New Users | |||
In Word, how do I surpress headers and footers on page 2 | Microsoft Word Help | |||
In Word, how can I see all files (*.*) in "save as"? | New Users | |||
How do I create & merge specific data base & master documents? | New Users |