Automating emails from Access using Outlook 97 and Access 97
by VGltIExvbmc » Fri, 17 Jun 2005 03:41:03 GMT
Hello, I have used code in Access and Excel 2002 that enabled me to send an
email with file attachments from Access or Excel. I am now with a firm which
uses Office 97 and my code doesn't work. Is it possible to send an email from
within Access 97? If so, could you point me in the direction of a source of
information it? I have no idea where I'm going wrong..
Many thanks in advance
Tim Long
Re: Automating emails from Access using Outlook 97 and Access 97
by Sue Mosher [MVP-Outlook] » Fri, 17 Jun 2005 04:35:46 GMT
Yes, it should be possible since all versions of Outlook support external automation using methods like Application.CreateItem to create a new mail message and MailItem.Attachments.Add to add an attachment. It might be helpful if you posted a code snippet to start the discussion.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.**--****.com/
Re: Automating emails from Access using Outlook 97 and Access 97
by VGltIExvbmc » Fri, 17 Jun 2005 05:36:07 GMT
Hello, I've taken out the content of SubjectCell, MsgTxt and the recipient
email address in the following, but the rest is as I had it when I tried to
run it, including the comments. The code halted at the line: Set OL =
CreateObject("Outlook.Application"). As you can tell, I'm an amateur at VBA
(no error handling or checking to make sure applications are open etc.. I
alone used to run this procedure and knew what I needed to have available)!
I had previously used it in Excel 2000 to send emails with xls attachments.
I am hoping to be able to do the same, more or less, from Access 97 (run
queries, save the results to xls files and email the files to the recipients).
Sub ResearchContactsEmail()
Dim OL As Object, MailSendItem As Object
Dim MsgText As String, SubjectCell As String, SendFile As String
currDate = Date
currStr = Format(currDate, "d_mmm_yy")
SubjectCell = " "
MsgTxt = " "
'Start the Outlook session
Set OL = CreateObject("Outlook.Application")
Set MailSendItem = OL.CreateItem(olMailItem)
'Create the message
With MailSendItem
.Subject = SubjectCell
.Body = MsgTxt
.To = " "
.Attachments.Add "C:\New_Research_Contacts_" & currStr & ".xls"
.Send
End With
Set OL = Nothing
End Sub
Re: Automating emails from Access using Outlook 97 and Access 97
by Sue Mosher [MVP-Outlook] » Fri, 17 Jun 2005 06:46:25 GMT
Are you running an anti-virus program that includes script blocking? If so, chances are that it is blocking the call to CreateObject("Outlook.Application").
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.**--****.com/
Re: Automating emails from Access using Outlook 97 and Access 97
by VGltIExvbmc » Sat, 18 Jun 2005 00:21:04 GMT
I think that may well be the case, because security is a big issue with the
firm.. I guess that means I won't be able to use this functionality?
Thanks again
Tim Long
Re: Automating emails from Access using Outlook 97 and Access 97
by Sue Mosher [MVP-Outlook] » Sat, 18 Jun 2005 04:40:23 GMT
ot without upgrading Office (so you can use Outlook VBA) or getting rid of the script blocker.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Tim Long" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ...
Similar Threads:
1.sendobject using Access 97 and Outlook WEB Access
I have been sending auto emails using the sendobject
command in a macro using outlook 97. I recently upgraded
to Outlook WEB Access. Can I still utilize the sendobject
command to send an email using a macro? At present, it
appears that ACCESS 97 can't connect to the microsoft
exchange server.
2.Access 97 & Outlook 97/98
I have downloaded the WZMAPI80 and installed it.
Question is I have an idea to design a database to import the email (This
will only copy it from Outlook to Access correct?), can I do anything to 1)
import the emails at regular intervals say evey 10 minutes and 2) the
Database alert me when new mail has been imported then 3) show me just the
new mail??
Basically all our work in our department arrives to a central email box
which a number of users access to and I would like to be able to see what
email has been actioned, when and what action the other people in my
department have have taken with that email query
3.Can I remove Office 97 but leave Access 97 & then install Office 2
Currently we run Office 97 Pro in our organisation but need to upgrade to Office 2000. Unfortunately we have hundreds of Access 97 databases, so my question is:
Can we upgrade from Office 97 to Office 2000, uninstalling all Office 97 components except for Access 97 and installing all Office 2000 components except for Access 2000?
If so how can this be done without firstly removing Office 97 completely, then installing Office 2000 then finally installing Access 97
4.Office 2003 & Office 97, Specifically Access 97
Still having a problem trying to reinstall Access 97 from
Office 97 CD after viewing the Office 2003 trial version.
Like I said, I uninstalled Office 97 before installing the
Office 2003 Trial CD. I downloaded the MSVBVM50.EXE and
ran (excuted the setup) it. Did not fix the problem.
Still unable to open the setup of Office 97 from the CD.
Sounds like the corrupted file oleaut32.dll is the one on
the CD inside the OS. The Office 97 CD was working fine
until I used the Office 2003 trial version. The reason I
know it worked is because I have another old computer I
loaded it on prior to the Office 2003 sample loaded. I
have a major problem, I CAN NOT ACCESS MY DATA BASE
created in access 97 from my computer because I am unable
to reinstall access 97. HELP ???????????
5.Overflow error from Access 97 to Excel 97
6. accessing contacts from outlook 2003 by using outlook 97
7. How do you access Outlook address book from MS Access 97
8. Create Outlook Message using Access 97 data