VB Error 2024

G

Guest

Hi,

I have been asked if it is possible to print a report and to also email it
to someone.
The code behind the button is shown below....

DoCmd.OpenReport "rptBudgets", acViewPreview

DoCmd.OutputTo acOutputReport, "rptBudgets", "Snapshot Format",
"C:\Temp", False

Set outl = CreateObject("Outlook.Application")
Set mail = outl.CreateItem(olMailItem)
mail.To = "(e-mail address removed)"
mail.Subject = "Budgets"
mail.attachments.Add "C:\Temp\Budgets"
mail.display
SendKeys "^{ENTER}"

Set outl = Nothing
Set mail = Nothing

Unfortunately, I am getting error 2024:-

"The report snapshot was not created because you don't have enough free
diskspace for temporary work files"

Any ideas anyone please?
 
G

Guest

Looks like you did not give a file name to save to try:

DoCmd.OutputTo acOutputReport, "rptBudgets", "Snapshot Format",
"C:\Temp\budgets.snp", False

then

mail.attachments.Add "C:\Temp\Budgets.snp"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top