473,809 Members | 2,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SendObjec t.) 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("O utlook.Applicat ion")
Set oMail = oLook.createite m(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 4349
<jd****@yahoo.c om> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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.SendObjec t.) 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.A dd (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*********@ho tmail.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.Ad d (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.c om> wrote in message
news:75******** *************** ***@posting.goo gle.com...
"Rick Brandt" <ri*********@ho tmail.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.Ad d (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
1826
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 code? Thank you Michel
1
1921
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 following link. http://www.microsoft.com/technet/community/scriptcenter/en tscr/scrent16.mspx while executing this code in vbs file i was getting error:
3
18294
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" #include <iostream> #include <iomanip> #include <string>
3
13708
by: Yammy Hung | last post by:
How to print out an integer (int) in C language without using printf()? Thanks in advance!
37
2045
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
2864
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 additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
94
11532
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 keeping a counter that kept a tab on how many times I subtracted. Later, the EA sport guy told me that of course there are can be better technique by using bit operator.
3
6640
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
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.