Export and email table

  • Thread starter Thread starter MackBlale
  • Start date Start date
M

MackBlale

I would like to add a button to an existing database that will export the
table to an EXCEL spreadsheet and email the file to a pre-determined
address. I am using ACCESS 2007. Suggestions with code are appreciated.
 
MackBlale said:
I would like to add a button to an existing database that will export the
table to an EXCEL spreadsheet and email the file to a pre-determined
address. I am using ACCESS 2007. Suggestions with code are appreciated.

Sample code:

DoCmd.TransferSpreadsheet acExport, ,
"Employees","C:\Workbooks\Employees.xls", True, "A1:G12"

Description of code from the helpfile:

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename,
filename[, hasfieldnames][, range]
 
How do I get Outlook to send the email?
Mack

Arvin Meyer said:
MackBlale said:
I would like to add a button to an existing database that will export the
table to an EXCEL spreadsheet and email the file to a pre-determined
address. I am using ACCESS 2007. Suggestions with code are appreciated.

Sample code:

DoCmd.TransferSpreadsheet acExport, ,
"Employees","C:\Workbooks\Employees.xls", True, "A1:G12"

Description of code from the helpfile:

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename,
filename[, hasfieldnames][, range]
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
There is some sample code on my website:

http://www.datastrat.com/Code/OutlookEmail.txt
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


MackBlale said:
How do I get Outlook to send the email?
Mack

Arvin Meyer said:
MackBlale said:
I would like to add a button to an existing database that will export the
table to an EXCEL spreadsheet and email the file to a pre-determined
address. I am using ACCESS 2007. Suggestions with code are appreciated.

Sample code:

DoCmd.TransferSpreadsheet acExport, ,
"Employees","C:\Workbooks\Employees.xls", True, "A1:G12"

Description of code from the helpfile:

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename,
filename[, hasfieldnames][, range]
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Thanks for your help
Mack
Arvin Meyer said:
There is some sample code on my website:

http://www.datastrat.com/Code/OutlookEmail.txt
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


MackBlale said:
How do I get Outlook to send the email?
Mack

Arvin Meyer said:
I would like to add a button to an existing database that will export
the table to an EXCEL spreadsheet and email the file to a pre-determined
address. I am using ACCESS 2007. Suggestions with code are
appreciated.

Sample code:

DoCmd.TransferSpreadsheet acExport, ,
"Employees","C:\Workbooks\Employees.xls", True, "A1:G12"

Description of code from the helpfile:

DoCmd.TransferSpreadsheet [transfertype][, spreadsheettype], tablename,
filename[, hasfieldnames][, range]
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top