Bryan Carbonnell
carbonnb at sympatico.ca
Thu May 19 20:35:22 CDT 2005
On 19 May 2005 at 17:45, Arthur Fuller wrote: > Assume a Word template (.dot) containing a table. This table contains > bookmarks which are filled from an Access app using code that finds > the bookmarks and stuffs text into them. > > This works fine for individual bookmarks, but what if the table has > multiple rows. How do I distinguish them? Often the query in Access > will return only one row, but sometimes it might return say 10 rows. > Then what do I do? Am I going about this in completely the wrong way, > using bookmarks? Should I be thinking of a completely other approach, > such as, I don't know, maybe embedding an Excel sheet in place of the > table and drawing the data from SQL into the sheet first? Why a table? Is it tabular data? Why not try using tabstops for alignment, or do you need the borders. If you look at the sample db and word doc that are part of the article I wrote for M2M, you can see how I wrote multi-line tabular data with tabstops from Access out to Word. The article and demo file can be found at http://www.databaseadvisors.com/newsletters/newsletter072002/0207worda utomationpt2.htm Basically in the template you set the tabstops (right, left, centre...) to where you want them, insert a bookmark and then insert the data, complete with tabs at the bookmark on record at a time. When you hit the next record, send a CrLf to the doc, and then insert the next record. The demo shows it much better that I have explained it. -- Bryan Carbonnell - carbonnb at sympatico.ca Why is it that inside every older person is a younger person wondering what the heck happened?