My collegue and I (more like my collegue) has found a bit of code that will
allow me to automatically send an e-mail from MS Access 2000, using the
Outlook. However, Outlook is generating a prompt when doing so. Below is
the code being used.
Public Function SendCustomers()
Dim DB As Database, oOutlookApp As Outlook.Application, LS_Filename As
String
Dim oMailItem As Outlook.mailitem, oAttachments As Outlook.Attachments
Set oOutlookApp = New Outlook.Application
Set oMailItem = oOutlookApp.CreateItem(olMailItem)
Set oAttachments = oMailItem.Attachments
Set DB = CurrentDb()
LS_Filename = "<File path and File name>"
DoCmd.TransferText acExportDelim, , "<Access Data>", LS_Filename & ".TXT",
True
LS_ShellCmd = "C:\WINNT\PKZIP.EXE " & LS_Filename & ".ZIP " & LS_Filename &
".TXT"
LD_Retval = Shell(LS_ShellCmd, vbHide)
oMailItem.To = "<Receipient>"
oMailItem.Subject = "Customer List"
oMailItem.Body = "Here is the latest Customer List."
oAttachments.Add "<File path and File Name>", olByValue, 1, "Customer List"
oMailItem.Send
Set oMailItem = Nothing
Set oOutlookApp = Nothing
End Function
That is the basic concept of what I am trying to do. What is puzzling me,
is that Outlook is generating the following prompt...
A program is trying to automatically send e-mail on your behalf;
Do you want to allow this?
If this is unexpected, it may be a virus and you should choose "No".
It then displays a progress bar for a fleeting few seconds and then enables
the "Yes" option once the progress bar is finished.
What I want is to not have this prompt come up at all and want the e-mail to
be sent through automatically.
Your help is appreciated.
Bill Njaheim
Thank you.
--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams
"Bill Njarheim" <bnja...@hotmail.com> wrote in message
news:jJk37.25332$E93.4...@news1.telusplanet.net...
If you're the administrator in an Exchange Server or HP OpenMail
environment, you can reduce the impact of the security prompts with
administrative tools. See http://www.slipstick.com/outlook/esecup/admin.htm.
If it's an application you wrote yourself, you can use one of these two
approaches to redo the program:
-- Use Extended MAPI (see http://www.slipstick.com/dev/mapi.htm) and C++
or Delphi
-- Use Redemption (http://www.dimastr.com/redemption/)
--
Sue Mosher, Outlook MVP
Author of
Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com
"Bill Njarheim" <bnja...@hotmail.com> wrote in message
news:jJk37.25332$E93.4...@news1.telusplanet.net...