473,396 Members | 1,975 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,396 software developers and data experts.

Include Report in Email Without Using SendObject

I'm using Access 97. In the OnClick event of a button I have the code
below. I looks at txtEmail and sends an e-mail message without
further action from the user (user does not have to click Send as he
would if he used DoCmd.SendObject.) However, I want to attach a
report in Snapshot format. How would I modify my code to include a
report?

Thank you,
JD

Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object

strEmail = Me!txtEMail
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.createitem(0)
With oMail
.to = strEmail
.body = "Your vacation and/or personal holidays have been
approved or rejected. See attached."
.Subject = "Vacation and/or Personal Holiday Request"
.Send
End With
Nov 12 '05 #1
3 4320
<jd****@yahoo.com> wrote in message
news:75**************************@posting.google.c om...
I'm using Access 97. In the OnClick event of a button I have the code
below. I looks at txtEmail and sends an e-mail message without
further action from the user (user does not have to click Send as he
would if he used DoCmd.SendObject.) However, I want to attach a
report in Snapshot format. How would I modify my code to include a
report?


You would first use DoCmd.OutputTo to create a file on disk of your
Snapshot report and then use your Outlook automation (line below) to add
the file as an attachment. You might want to include a line at the end of
your procedure to delete (Kill) the file from disk.

..Attachments.Add (AttachmentPath)

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2
"Rick Brandt" <ri*********@hotmail.com> wrote in message news:<bm************@ID-98015.news.uni-berlin.de>...
You would first use DoCmd.OutputTo to create a file on disk of your
Snapshot report and then use your Outlook automation (line below) to add
the file as an attachment. You might want to include a line at the end of
your procedure to delete (Kill) the file from disk.

.Attachments.Add (AttachmentPath)


Thanks, Rick. Do I have to save this to my hard drive, or can I save
it to a network drive (on the server)?

JD
Nov 12 '05 #3
<jd****@yahoo.com> wrote in message
news:75**************************@posting.google.c om...
"Rick Brandt" <ri*********@hotmail.com> wrote in message

news:<bm************@ID-98015.news.uni-berlin.de>...
You would first use DoCmd.OutputTo to create a file on disk of your
Snapshot report and then use your Outlook automation (line below) to add the file as an attachment. You might want to include a line at the end of your procedure to delete (Kill) the file from disk.

.Attachments.Add (AttachmentPath)


Thanks, Rick. Do I have to save this to my hard drive, or can I save
it to a network drive (on the server)?


You should be able to save it anywhere, but if you just want to delete the
file after it has been attached to the Email, then you might as well save
it to a local disk so that the I/o is faster.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #4

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

Similar topics

4
by: Michel | last post by:
I'm looking for an asp code who can send an email without using a mail component. I started to write somethings using winsock but I don't have enough time to finish it. Does somebody have a such...
1
by: dave | last post by:
hi guys I m trying to execute few lines code tht i have copies from microsoft tech script centre. basically its to send email without using any smtp service. u can find the code snippet from...
3
by: James DeClerk | last post by:
Hi everyone. I have a guid that's in string format. I would like to convert it to a GUID. I'm doing this on the unix platform, so it will apply to only to GCC/G++. #include "stdafx.h"...
3
by: Yammy Hung | last post by:
How to print out an integer (int) in C language without using printf()? Thanks in advance!
37
by: Rajesh | last post by:
I was informed tht $SUBJECT was asked in M$ interview. Real imp. is no. of ways to achive it. mine sol. was.... int main() { if(printf("foo")) { ; } else { ; }
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
94
by: krypto.wizard | last post by:
Last month I appeared for an interview with EA sports and they asked me this question. How would you divide a number by 7 without using division operator ? I did by doing a subtraction and...
3
by: phill86 | last post by:
Hi I am using the following code to send an email from access via outlook automatically DoCmd.SendObject acSendReport, stDocName, acFormatRTF, "User", , , , , False
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.