Developer
Developer at UltraDNT.com
Mon Dec 22 09:31:54 CST 2003
Well, the way I do this, there IS an instance of Word, but just 1, and it is instantiated by Access. I feed the recordset that results from the user's input parameters to a function that generates a text file (in CSV; this method pre-dates XML for me ... I've tried it, but xml is sometimes still a bit too messy for this, up to Office XP, anyway) ... Loop the field names first, then the data. This is always saved to "c:\temp\rpt.csv", then, I open Word or Excel via automation from within Access. In Excel's case, just open the .csv; with Word, I present the user a list of .DOT's in the same folder as the BE. The Mail Merge then is executed with the user's chosen .DOT and the just-generated .CSV. This was all a fair bit of code, but completely re-usable project to project (using this since '97). Hth, Steve -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Monday, December 22, 2003 9:04 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] mail merge from text file uhh... Well... Someone recommended text files as if that was a natural way to go... but of course I can generate temp db files. Apparently if you use something like Access or Excel to hold the data then Word uses automation to open an instance of that program to feed it the data. I am assuming that if you use a text file that automation step just goes away and the text file is simply read by Word. Of course knowing MS they might very well open an instance of Word to read the text file and feed it to Word... John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock Sent: Monday, December 22, 2003 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] mail merge from text file Hi John Why not export your data to a temp database (mdb) file? You know how to create and fill those ... /gustav > I am finally doing the mail merge into Word that has been threatening > for the last 6 months. What I have discovered is that if I specify a > query directly, Word opens a NEW instance of Access and opens whatever > db the query is in. It happens that the FE the query is in has an > opening login screen etc. so that doesn't work too well. Given that, > I need to export the > data somewhere that word can get at it unencumbered. > Someone on the list suggested exporting the data to text files, then > doing the mail merge from those text files. Can someone elucidate a > bit there? Is the text file comma delimited? Does it need the > bookmark name for where > each datum is going? IOW what is the format of the text file going to > be? _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com