Hello,
I'm a non_VBA coder who has been asked to update the following Function:
**************************
Function EMAILER_REV_BY_ACCTCODE_MACRO()
On Error GoTo RA_EMAILER_Err
DoCmd.SetWarnings False
DoCmd.SelectObject acForm, "SalesAssoc", False
DoCmd.SendObject acQuery, "Rev by AcctCode", "MicrosoftExcel(*.xls)", Forms![SalesAssoc]![e-mail], "", "", "Spreadsheet of Core Revenue for Current Month by Account", "Attached please find an Excel spreadsheet of the Core revenue for your Accounts. ", False, ""
DoCmd.RunCommand acCmdRefreshPage
DoCmd.RunCommand acCmdRecordsGoToNext
RA_EMAILER_Exit:
Exit Function
RA_EMAILER_Err:
MsgBox Error$
End Function
********************************
The function works fine, but the size of the Excel file is too large to send via email (mailbox size restriction). The user has WinZip installed on their computer. My thought is that the code needs to be modified so that the query is called and the results sent to an Excel file, then zip the file, then email the zip. I've tested zipping the Excel file, and the resulting size is well within the mailbox size limit.
How can I modify the above code to create the Excel file, fill the file with the query results, zip the file, then send it via email?
The code is contained within an MS Access 2000 Module. The O/S is Windows XP SP2.
Thank you for your help!
cdun2
I'm a non_VBA coder who has been asked to update the following Function:
**************************
Function EMAILER_REV_BY_ACCTCODE_MACRO()
On Error GoTo RA_EMAILER_Err
DoCmd.SetWarnings False
DoCmd.SelectObject acForm, "SalesAssoc", False
DoCmd.SendObject acQuery, "Rev by AcctCode", "MicrosoftExcel(*.xls)", Forms![SalesAssoc]![e-mail], "", "", "Spreadsheet of Core Revenue for Current Month by Account", "Attached please find an Excel spreadsheet of the Core revenue for your Accounts. ", False, ""
DoCmd.RunCommand acCmdRefreshPage
DoCmd.RunCommand acCmdRecordsGoToNext
RA_EMAILER_Exit:
Exit Function
RA_EMAILER_Err:
MsgBox Error$
End Function
********************************
The function works fine, but the size of the Excel file is too large to send via email (mailbox size restriction). The user has WinZip installed on their computer. My thought is that the code needs to be modified so that the query is called and the results sent to an Excel file, then zip the file, then email the zip. I've tested zipping the Excel file, and the resulting size is well within the mailbox size limit.
How can I modify the above code to create the Excel file, fill the file with the query results, zip the file, then send it via email?
The code is contained within an MS Access 2000 Module. The O/S is Windows XP SP2.
Thank you for your help!
cdun2