You are currently viewing the Word VBA section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Hi everyone, I have a quick 'is it possible' question
At my current job we have order info in a database and each week we run a report which extracts something similar to the following into an excel spreadsheet. It shows what each customer has bought
CustomerID Customer Name Order Cost
ABCD1 Acme £200
DEFG Widget £150
ABCD1 Acme £120
Basically, we then generate letters per line using mail merge but this is wasteful if the same customer has made multiple orders. Is there a simple way to get word to recognise multiple orders and create a line in the document for each item ordered? For example, using the data above, the end result would be 1 letter for Acme with two order items inserted instead of 2 seperate letters with one item each. Can anyone suggest a few basic steps for this or even advise how it might be done better (get it in access and use SQL to join then do something else?).
I really dont want to take up too much of anyones time, just wondering if anyone has done this before using VBA code or if it is going to be a nightmare. I have coded Outlook VBA code before so I should be capable of coding something quite nice but advice on a more elegant solution if available would be great.