Export and email table

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.
 
A

Arvin Meyer [MVP]

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]
 
M

MackBlale

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
 
A

Arvin Meyer [MVP]

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
 
M

MackBlale

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
 
Top