Email Multiple Reports on one Email | | |
is this possable to send more than 1 report in one email | | | | re: Email Multiple Reports on one Email
Mega1 wrote:[color=blue]
> is this possable to send more than 1 report in one email
>
>[/color]
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) | | | | re: Email Multiple Reports on one Email
i want to automate this so when people click on it the email just sends
"MGFoster" <me@privacy.com> wrote in message
news:T8pVd.9653$MY6.2172@newsread1.news.pas.earthl ink.net...[color=blue]
> Mega1 wrote:[color=green]
> > is this possable to send more than 1 report in one email
> >
> >[/color]
> 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)[/color] | | | | re: Email Multiple Reports on one Email
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" <mega1@oceanfree.net> wrote in message
news:fBpVd.48701$Z14.36196@news.indigo.ie...[color=blue]
>i want to automate this so when people click on it the email just sends
> "MGFoster" <me@privacy.com> wrote in message
> news:T8pVd.9653$MY6.2172@newsread1.news.pas.earthl ink.net...[color=green]
>> Mega1 wrote:[color=darkred]
>> > is this possable to send more than 1 report in one email
>> >
>> >[/color]
>> 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)[/color]
>
>[/color] | | | | re: Email Multiple Reports on one Email
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 "mselcuk@ford.com.tr"
OI.CC = "anyone@ford.com.tr"
OI.BCC = "someone@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 | | | | re: Email Multiple Reports on one Email
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" <mselcuk@ford.com.tr> wrote in message
news:7d09ceaa.0503030754.346e08ba@posting.google.c om...[color=blue]
> 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.
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[/color]
- - -[color=blue]
>
> Sub SendMessage()
> Dim OL As Outlook.Application, OI As Outlook.MailItem, OA As[/color]
Outlook.Attachments[color=blue]
> Set OL = Outlook.Application
> Set OI = OL.CreateItem(olMailItem)
> OI.Recipients.Add "mselcuk@ford.com.tr"
> OI.CC = "anyone@ford.com.tr"
> OI.BCC = "someone@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[/color] | | | | re: Email Multiple Reports on one Email
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 | | | | re: Email Multiple Reports on one Email
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:dash10@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
'================================================= ==== |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|