473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Email Multiple Reports on one Email

is this possable to send more than 1 report in one email
Nov 13 '05 #1
7 12554
Mega1 wrote:
is this possable to send more than 1 report in one email

Send each report as a separate attachment. Save the report as Snapshot
files (or something else) and then run the email & just attach the saved
files.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
i want to automate this so when people click on it the email just sends
"MGFoster" <me@privacy.com> wrote in message
news:T8*****************@newsread1.news.pas.earthl ink.net...
Mega1 wrote:
is this possable to send more than 1 report in one email

Send each report as a separate attachment. Save the report as Snapshot
files (or something else) and then run the email & just attach the saved
files.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 13 '05 #3
If you're interested I will create a sample database (A2003) which should
meet your needs; let me know.you can email me directly.

Cheers,

Dave
"Mega1" <me***@oceanfree.net> wrote in message
news:fB*******************@news.indigo.ie...
i want to automate this so when people click on it the email just sends
"MGFoster" <me@privacy.com> wrote in message
news:T8*****************@newsread1.news.pas.earthl ink.net...
Mega1 wrote:
> is this possable to send more than 1 report in one email
>
>

Send each report as a separate attachment. Save the report as Snapshot
files (or something else) and then run the email & just attach the saved
files.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)


Nov 13 '05 #4
Hi there,

All that you need is just creating an Outlook item and
add some code there to trigger it.

Also Microsoft Outlook 9.0 Object Library must be checked in
Tool/References area.

I added a short sample below.

I hope you'll find your answers there.

Take care.

Murat.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Sub SendMessage()
Dim OL As Outlook.Application, OI As Outlook.MailItem, OA As Outlook.Attachments
Set OL = Outlook.Application
Set OI = OL.CreateItem(olMailItem)
OI.Recipients.Add "ms*****@ford.com.tr"
OI.CC = "an****@ford.com.tr"
OI.BCC = "so*****@ford.com.tr"
OI.Subject = "Sample"
OI.Body = "Hi there"
Set OA = OI.Attachments
OA.Add "L:\FMS\REPORTS\Lease.xls", olByValue, 1, "Leasing Report"
OA.Add "L:\FMS\REPORTS\Action.xls", olByValue, 1, "Action Report"
OA.Add "L:\FMS\REPORTS\Finance.xls", olByValue, 1, "Finance Report"
OI.Send
End Sub
Nov 13 '05 #5
This is the code i was using
Dim MyDB As Database
Dim MyRS As dao.Recordset
Dim TheAddress As String
Dim stDocName As String
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("qryEmailFlyer")
MyRS.MoveFirst
Do Until MyRS.EOF
TheAddress = MyRS![EmailAddress]

stDocName = "Movie Program"
DoCmd.SendObject acReport, stDocName, acFormatSNP, TheAddress, , ,
"movie program Starting " & Text2, "If you cannot view please download the
viewer at
http://www.microsoft.com/downloads/details.aspx?FamilyID=b73df33f-6d74-423d-8274-8b7e6313edfb&DisplayLang=en",
False
DoCmd.SendObject acReport, "Synopsis", acFormatSNP, TheAddress, , ,
"Synopsis", , False

MyRS.MoveNext
Loop
"Fahrettin Murat Selcuk" <ms*****@ford.com.tr> wrote in message
news:7d**************************@posting.google.c om...
Hi there,

All that you need is just creating an Outlook item and
add some code there to trigger it.

Also Microsoft Outlook 9.0 Object Library must be checked in
Tool/References area.

I added a short sample below.

I hope you'll find your answers there.

Take care.

Murat.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub SendMessage()
Dim OL As Outlook.Application, OI As Outlook.MailItem, OA As Outlook.Attachments Set OL = Outlook.Application
Set OI = OL.CreateItem(olMailItem)
OI.Recipients.Add "ms*****@ford.com.tr"
OI.CC = "an****@ford.com.tr"
OI.BCC = "so*****@ford.com.tr"
OI.Subject = "Sample"
OI.Body = "Hi there"
Set OA = OI.Attachments
OA.Add "L:\FMS\REPORTS\Lease.xls", olByValue, 1, "Leasing Report"
OA.Add "L:\FMS\REPORTS\Action.xls", olByValue, 1, "Action Report"
OA.Add "L:\FMS\REPORTS\Finance.xls", olByValue, 1, "Finance Report"
OI.Send
End Sub

Nov 13 '05 #6
I read your message to quickly; my example provides the option to send one
report to multiple email addresses. Regardless, it may prove of value, and
can easily be modified: the zipped example is only 96kb.

Cheers,

Dave
Nov 13 '05 #7
Code used for Button to send email:

'================================================= ====
Private Sub cmdSendRpt_Click()

' Attach Access Snapshot Report to Email & Send

Dim strTO As String
Dim strCc As String
Dim cnt As Long

If Me.lstEMailAddresses.ItemsSelected.Count = 0 Then
MsgBox "No email addresses have been selected; please select one or
more " _
& "email addresses, and then try again."
Else

For cnt = 0 To Me.lstEMailAddresses.ItemsSelected.Count - 1
strTO = strTO & ";" & Me.lstEMailAddresses.Column(0, _
Me.lstEMailAddresses.ItemsSelected(cnt))

Next cnt

strTO = Mid(strTO, 2)
' Send Report using MS Access Snapshot
DoCmd.SendObject acReport, "rptPersEMail", "SnapshotFormat(*.snp)", _
strTO, strCc, "", "Place Your Email Subject Heading Here", "From the
Office " _
& "of... Your Name Here - Report Name Here (Optional)." & vbCrLf &
vbCrLf _
& "Please see attached MS Access Snapshot Report" & vbCrLf & vbCrLf &
vbCrLf & vbCrLf & "----------------------------" _
& vbCrLf & vbCrLf & "Microsoft Snapshot Viewer Required to view
attachment: Download Snapshot " _
& "Viewer from the Microsoft Site: " _
&
"http://www.microsoft.com/downloads/details.aspx?familyid=B73DF33F-6D74-423D-8274-8B7E6313EDFB&displaylang=en"
_
& vbCrLf & vbCrLf & "The Snapshot Viewer enables you to view a report
snapshot without having the standard or run-time versions of Microsoft
Access.", True

End If
End Sub

'================================================= ====

and

Create a new module:

'================================================= ====

Option Compare Database 'Use database order for string comparisons
Option Explicit 'Require variables to be declared before being
used

'************ Code Start **********
'This code was originally written by Dev Ashish.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Dev Ashish

Private Declare Function apiShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long

'***App Window Constants***
Public Const WIN_NORMAL = 1 'Open Normal
Public Const WIN_MAX = 2 'Open Maximized
Public Const WIN_MIN = 3 'Open Minimized

'***Error Codes***
Private Const ERROR_SUCCESS = 32&
Private Const ERROR_NO_ASSOC = 31&
Private Const ERROR_OUT_OF_MEM = 0&
Private Const ERROR_FILE_NOT_FOUND = 2&
Private Const ERROR_PATH_NOT_FOUND = 3&
Private Const ERROR_BAD_FORMAT = 11&

'***************Usage Examples***********************
'Open a folder: ?fHandleFile("C:\TEMP\",WIN_NORMAL)
'Call Email app: ?fHandleFile("mailto:da****@hotmail.com",WIN_NORMA L)
'Open URL: ?fHandleFile("http://home.att.net/~dashish",
WIN_NORMAL)
'Handle Unknown extensions (call Open With Dialog):
' ?fHandleFile("C:\TEMP\TestThis",Win_Normal)
'Start Access instance:
' ?fHandleFile("I:\mdbs\CodeNStuff.mdb", Win_NORMAL)
'************************************************* ***

Function fHandleFile(stFile As String, lShowHow As Long)

Dim lRet As Long
Dim varTaskID As Variant
Dim stRet As String

'First try ShellExecute
lRet = apiShellExecute(hWndAccessApp, vbNullString, _
stFile, vbNullString, vbNullString, lShowHow)

If lRet > ERROR_SUCCESS Then
stRet = vbNullString
lRet = -1
Else

Select Case lRet
Case ERROR_NO_ASSOC:
'Try the OpenWith dialog
varTaskID = Shell("rundll32.exe shell32.dll,OpenAs_RunDLL " _
& stFile, WIN_NORMAL)
lRet = (varTaskID <> 0)
Case ERROR_OUT_OF_MEM:
stRet = "Error: Out of Memory/Resources. Couldn't Execute!"
Case ERROR_FILE_NOT_FOUND:
stRet = "Error: File not found. Couldn't Execute!"
Case ERROR_PATH_NOT_FOUND:
stRet = "Error: Path not found. Couldn't Execute!"
Case ERROR_BAD_FORMAT:
stRet = "Error: Bad File Format. Couldn't Execute!"
Case Else:
End Select

End If

fHandleFile = lRet & _
IIf(stRet = "", vbNullString, ", " & stRet)

End Function
'================================================= ====
Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: halsa | last post by:
hi I need to append multiple reports to a single report.For example I have 2 Pending Invoice reports to print.The report viewer has to preview these two reports like two different pages and...
0
by: Eliezer Figueroa | last post by:
Managing Multiple Excel incoming files? I have this situation. I have a client which have several locations they work primary with excel forms and they are thinking in doing reports with them....
0
by: AIMTech | last post by:
We have an IIS+ASP based application server that is capable of providing complex reports to hundreds of users but in some circumstances these reports can take a long time to create. However the...
2
by: Sigurd Bruteig | last post by:
Hi all! I have a problem printing multiple reports. The code i use is: Dim stDocName As String stDocName = "rptInvoice" DoCmd.OpenReport stDocName, acNormal, , " = date()" The problem is that...
1
by: Jeremy | last post by:
I have built a form that calls queries. I have the first 2 set up as select queries, and the third set up as a make table query. When multiple users are on this application at the same time, they...
3
by: ian_jacobsen | last post by:
First let me start by saying that this problem is not consistently reproducible. I have a windows service that creates reports for a group of entities. This service can process multiple groups at...
8
alpnz
by: alpnz | last post by:
Hi, I have a need to send snap reports to various shipping agents. E.g. A PalletCard, A FreightNote, A Consignment Advice, and an Export declaration of Conformity. It is easy enough to code a...
4
n8kindt
by: n8kindt | last post by:
ok, i've done quite a bit of research on my problem here. random "! " will appear in my email that i'm sending thru cdo. i've learned that this problem occurs when there are long lines of html (or...
5
by: MyWaterloo | last post by:
So, I have a database I'm using for Employee Time Sheets. The pay period is a two week cycle. There is one report for each week. I would like to just combine the two weeks into one report, but my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.