Export Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query which I used to export to a Microsoft Word Mailmerge format
and I'm wondering how can I do this using code so that at a click of a
button, it could be exported instead of having to run the query and then
manually go to File>Export...? Thanks.
ck
 
Thanks for pointing me in the right direction and after going thro the help,
I found that the TransferText method is what I was looking for. However, it
seems that as part of the required variables, a filename and path is
required. Is it possible to let the user be prompted for a location to save
the file and provide a name like it could be done in the OutputTo method?
Thanks.
ck
 
You can do that if you use the TransferText method in code, rather than the
TransferText action in a macro.

In code, you can make an API call to pop up the Windows FileSaveAs dialog
and let the user name the file. Details in:
Call Windows File Open/Save Dialog box
at:
http://www.mvps.org/access/api/api0001.htm

Note that you cannot use the FileDialog object from the Office library to do
this. It appears to offer the option of Save As, but does not work, so you
have to use the API call above.
 
Back
Top