Sending Email From Access 2003, and Security Warning Popup

G

Guest

Code example to generate error message.

DoCmd.SendObject , , , "(e-mail address removed)", , , "Test Sending Automatic
Email", "When the SendObject is set to False, meaning that you will send the
email immediately. You get this popup in Windows XP for a critical stop. ",
False, ""

You get a critical stop box.

Microsoft Office Outlook

“!†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â€. [Yes] [No] [Help]


You get a critical stop box.

Microsoft Office Outlook

“!†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â€. [Yes] [No] [Help]


This is my email and my Access 2003. There are some poorly written articles
and instructions on “signing macro†and establishing yourself as trusted
code. However, I have not been able to set up a system for trusted code.

I have not found a way to automatically send [Yes] by a macro. I have not
been able to set up a format where I provide the [Yes] key in advance.

I know this is designed to stop virus writers from sending emails without my
permission. Do I need to install direct mailer software to go around this
popup?

I am angered when Microsoft presumes to protect me from myself. The software
does not intuitively allow you to trust yourself. No doubt XP will be less
subject to viruses, but it also now stops me from being as productive as I
was under Windows 98.
 
G

Guest

Thanks "TPRatt"

However, I'm in a governmental enviornment where it is a bad idea to use
unapproved programms to get around security issues.

I'm also using Access Visual Basic, so (Outloo.Applicaiton) Office
Automation does not seem to work in Access 2003.

This code actually wroks for Word. Thanks to some suggestions in the group.
Note that for me and many beginners using a with statement is confusing. When
you are debugging you often can't find the error.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Add
oApp.Selection.TypeText Text:="Title"


This did not. Research on the newsgroup indicates that it should work.

' Dim oApp As Object
' Set oApp = CreateObject("Outlook.Application")

Idealy:

I want to be able to trust my own visual basic macros by signing them.
However, the helps do not adequately give me enough information to navigate
all of the signing requriements. Getting the digital signiture, Signing the
Macro, or Recognizing the trusted macro.



TPratt said:
You're going about it from the wrong direction.

Go to this website and download Outlook Redemption. I believe there are
some examples of code you can use. If not, let me know and I'll send you
some.

http://www.dimastr.com/redemption/



SacCourt said:
Code example to generate error message.

DoCmd.SendObject , , , "(e-mail address removed)", , , "Test Sending Automatic
Email", "When the SendObject is set to False, meaning that you will send the
email immediately. You get this popup in Windows XP for a critical stop. ",
False, ""

You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


This is my email and my Access 2003. There are some poorly written articles
and instructions on "signing macro" and establishing yourself as trusted
code. However, I have not been able to set up a system for trusted code.

I have not found a way to automatically send [Yes] by a macro. I have not
been able to set up a format where I provide the [Yes] key in advance.

I know this is designed to stop virus writers from sending emails without my
permission. Do I need to install direct mailer software to go around this
popup?

I am angered when Microsoft presumes to protect me from myself. The software
does not intuitively allow you to trust yourself. No doubt XP will be less
subject to viruses, but it also now stops me from being as productive as I
was under Windows 98.
 
T

TPratt

I am currently using Outlook Redemption within a Microsoft Access Module
(Visual Basic) and it works beautifully.

Good luck in your search...



SacCourt said:
Thanks "TPRatt"

However, I'm in a governmental enviornment where it is a bad idea to use
unapproved programms to get around security issues.

I'm also using Access Visual Basic, so (Outloo.Applicaiton) Office
Automation does not seem to work in Access 2003.

This code actually wroks for Word. Thanks to some suggestions in the group.
Note that for me and many beginners using a with statement is confusing. When
you are debugging you often can't find the error.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Add
oApp.Selection.TypeText Text:="Title"


This did not. Research on the newsgroup indicates that it should work.

' Dim oApp As Object
' Set oApp = CreateObject("Outlook.Application")

Idealy:

I want to be able to trust my own visual basic macros by signing them.
However, the helps do not adequately give me enough information to navigate
all of the signing requriements. Getting the digital signiture, Signing the
Macro, or Recognizing the trusted macro.



TPratt said:
You're going about it from the wrong direction.

Go to this website and download Outlook Redemption. I believe there are
some examples of code you can use. If not, let me know and I'll send you
some.

http://www.dimastr.com/redemption/



SacCourt said:
Code example to generate error message.

DoCmd.SendObject , , , "(e-mail address removed)", , , "Test Sending Automatic
Email", "When the SendObject is set to False, meaning that you will
send
the
email immediately. You get this popup in Windows XP for a critical
stop.
",
False, ""

You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


This is my email and my Access 2003. There are some poorly written articles
and instructions on "signing macro" and establishing yourself as trusted
code. However, I have not been able to set up a system for trusted code.

I have not found a way to automatically send [Yes] by a macro. I have not
been able to set up a format where I provide the [Yes] key in advance.

I know this is designed to stop virus writers from sending emails
without
my
permission. Do I need to install direct mailer software to go around this
popup?

I am angered when Microsoft presumes to protect me from myself. The software
does not intuitively allow you to trust yourself. No doubt XP will be less
subject to viruses, but it also now stops me from being as productive as I
was under Windows 98.
 
S

Steve Schapel

SacCourt,

Another third-party utlilty which I know others have used successfully
is available here...
http://www.contextmagic.com/express-clickyes/

Having said that, this is a macros newsgroup, and your question is not
related to macros, in fact you are using a VBA procedure here. And in
addition, it is really an Outlook security issue anyway, rather than
being Access-related, in which case a [post to an Outlook newsgroup may
get you a more authoritative response.
 
G

Guest

Thanks

This code: Set oItem = Application.CreateItem(0)
causes a compiler error in Access 2003

What version of Access and what code are you using that is successful.

Dim SafeItem
Dim oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an
instance of Redemption.SafeMailItem
'In Access 2003 the code that follows produces a Microsoft Visual Basic
Exclamation Box
'Compiler error:
'Method or data member not found.
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "(e-mail address removed)"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send

TPratt said:
I am currently using Outlook Redemption within a Microsoft Access Module
(Visual Basic) and it works beautifully.

Good luck in your search...



SacCourt said:
Thanks "TPRatt"

However, I'm in a governmental enviornment where it is a bad idea to use
unapproved programms to get around security issues.

I'm also using Access Visual Basic, so (Outloo.Applicaiton) Office
Automation does not seem to work in Access 2003.

This code actually wroks for Word. Thanks to some suggestions in the group.
Note that for me and many beginners using a with statement is confusing. When
you are debugging you often can't find the error.

Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Documents.Add
oApp.Selection.TypeText Text:="Title"


This did not. Research on the newsgroup indicates that it should work.

' Dim oApp As Object
' Set oApp = CreateObject("Outlook.Application")

Idealy:

I want to be able to trust my own visual basic macros by signing them.
However, the helps do not adequately give me enough information to navigate
all of the signing requriements. Getting the digital signiture, Signing the
Macro, or Recognizing the trusted macro.



TPratt said:
You're going about it from the wrong direction.

Go to this website and download Outlook Redemption. I believe there are
some examples of code you can use. If not, let me know and I'll send you
some.

http://www.dimastr.com/redemption/



Code example to generate error message.

DoCmd.SendObject , , , "(e-mail address removed)", , , "Test Sending Automatic
Email", "When the SendObject is set to False, meaning that you will send
the
email immediately. You get this popup in Windows XP for a critical stop.
",
False, ""

You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


This is my email and my Access 2003. There are some poorly written
articles
and instructions on "signing macro" and establishing yourself as trusted
code. However, I have not been able to set up a system for trusted code.

I have not found a way to automatically send [Yes] by a macro. I have not
been able to set up a format where I provide the [Yes] key in advance.

I know this is designed to stop virus writers from sending emails without
my
permission. Do I need to install direct mailer software to go around this
popup?

I am angered when Microsoft presumes to protect me from myself. The
software
does not intuitively allow you to trust yourself. No doubt XP will be less
subject to viruses, but it also now stops me from being as productive as I
was under Windows 98.
 
G

Guest

I thank you for the help and I'm looking over the click yes.

It is an interesting question whet

It is an interesting question whether or not Access Visual Basic procedures
belongs in a Macro discussion group. First, I have looked at the topics of
the Access Group and I do believe that this group is the most correct place
for Visual Basic procedures. When I review the issues under programming that
does not appear to be surrounding the topics I’m working with.

When I first started programming in Access I started with the “Macro
Language.†The more I read and studied most of the experts of the time Access
95 ant Access 97 recommended that the Visual Basic components were the
‘better’ way to handle macros. At that time I believed that both the Macro
language and Access Visual Basic Code were basically equivalent at least with
respect to a statement that they were both “macroâ€. I was also coming from
another programming language that used the word macro.

It was good advice; Access Visual Basic Code that I wrote in Access 97 has
worked extremely well through the Access 2000, Access XP and for the most
part Access 2003. Now I’m having some problems with AppActivate and Outlook
controls. When reading Access 2003 migration documentation Microsoft seems
to indicate that “Macros.†Would not work as they once did. I was very
pleased and surprised to find that the Access Visual Basic for the most part
has been forwards and backwards compatible.

My definition of macro comes from Microsoft Excel, Lotus and Enable Software
packages. There they use keystroke recorders and command codes for the most
part to accomplish specific tasks. If you use the record a macro button in
Microsoft Excel you will end up with a Visual Basic procedure. Therefore,
narrowly defining a macro as only “Access Macro Procedures†is provincial and
far to narrow even with respect to Microsoft Office integrated products.

My expertise, if I have any, is using the power of Access Visual Basic and
Access Tables to control other windows based applications. For example, I use
Access to audit, input and query SAP R/3, Outlook, legacy Telnet
applications, and flat data txt files used by my organization. These visual
basic commands do actually open other Windows based application and Send
Keystrokes to other applications.

You also seem to indicate that this is may be more appropriately an Outlook
security issue and not an Access 2003 issues. Here, I respectfully disagree.
I’m converting Access 97 code to Access 2003 code and trying to maintain
functionality. We have approximately 800 employees that routinely were sent
customized emails for updating contacts, validating work phone numbers, and
communicating with managers. Properly coded work allows us to customize the
language (subject and body) and send specialized query data as attachments.
The variables are all table driven. The power is in Access not Outlook. The
failure is in Access 2003 integration versus Access 97 integration with
Outlook which worked. In fact Microsoft lumps most of my favorite commands
as “Macro Security Risksâ€

I have spent several days working on the subtleties of the Outlook
integration issue of Access 2003 and Windows XP. At this point I’m going to
recommend that we keep several of our older computers in the previous desktop
stand of Access 97 and Windows 98 in order to preserve vital functionality
that Outlook Security Patches and Windows XP have emasculated. We have
already found that Access 97 will coexist on a Windows XP machine side by
side with Access 2003. I am very unhappy and frustrated that these functions
do not work inside our own firewall, with our own exchange server for email
addresses within our own domain. My network has authenticated my login and
the exchange server has been authenticated. Why can’t my own organization
trust that I am who I’m supposed to be and send emails? This trusted signor
is one thing for individual’s outsiders of our Microsoft Windows Server 2003.
With a C2 security rating or better I’m still not permitted to send email by
code?


Steve Schapel said:
SacCourt,

Another third-party utlilty which I know others have used successfully
is available here...
http://www.contextmagic.com/express-clickyes/

Having said that, this is a macros newsgroup, and your question is not
related to macros, in fact you are using a VBA procedure here. And in
addition, it is really an Outlook security issue anyway, rather than
being Access-related, in which case a [post to an Outlook newsgroup may
get you a more authoritative response.

--
Steve Schapel, Microsoft Access MVP

I am currently using Outlook Redemption within a Microsoft Access Module
(Visual Basic) and it works beautifully.

Good luck in your search...
 
S

Steve Schapel

SacCourt,

I apologise if I have misunderstood your original question. The message
box you were apparently seeing, which was causing the problem, is
generated via a security feature of Outlook. It is not related to
Access, and there is nothing that can be done with or within Access to
alter this fact.

As regards the other question, the situation is very simple. In Access,
macros are macros and VBA procedures are VBA procedures. Although they
are often used to achieve similar purposes, they are quite different,
the skills in using them are quite different, and they work in quite
different ways. This is a macros newsgroup. VBA procedures are not
macros. Therefore this is not really the appropriate venue to discuss
them. I realise that there is some confusion in the way the word
'macro' is used in other programming languages. And even within the
Microsoft Office environment, for example in Excel VBA procedures are
correctly called macros. But really, this is irrelevant... we are not
talking about other programming languages or about Excel, we are talking
about Access, and in Access macros are completely different.

There are many newsgroups where VBA procedures in Access are the
appropriate focus. Those that specifically relate to VBA are:
microsoft.public.access.modulescoding
microsoft.public.access.modulesdaovba
microsoft.public.access.formscoding
 
G

Guest

Thanks redemption was helpful for Access 2003 after redemption was installed.
Working code example:

Private Sub Command400_Click()
Set SafeItem = CreateObject("Redemption.SafeMailItem")
' create the Outlook session
Set objOutlook = CreateObject("Outlook.Application")
Set objNS = objOutlook.GetNamespace("MAPI")
objNS.Logon
' create the Message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
SafeItem.Item = objOutlookMsg
With SafeItem
.to = "(e-mail address removed)"
.Subject = "strSubject"
.Body = "strBody"
.Attachments.Add "C:\ttfile.txt"
.Importance = 2 'High =2 low = 1
.ReadReceiptRequested = True
'.Display
.Save
.Send
End With


Set objOutlookMsg = Nothing
Set objNS = Nothing
Set objOutlook = Nothing
Set SafeItem = Nothing




End Sub


TPratt said:
You're going about it from the wrong direction.

Go to this website and download Outlook Redemption. I believe there are
some examples of code you can use. If not, let me know and I'll send you
some.

http://www.dimastr.com/redemption/



SacCourt said:
Code example to generate error message.

DoCmd.SendObject , , , "(e-mail address removed)", , , "Test Sending Automatic
Email", "When the SendObject is set to False, meaning that you will send the
email immediately. You get this popup in Windows XP for a critical stop. ",
False, ""

You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


You get a critical stop box.

Microsoft Office Outlook

"!" 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". [Yes] [No] [Help]


This is my email and my Access 2003. There are some poorly written articles
and instructions on "signing macro" and establishing yourself as trusted
code. However, I have not been able to set up a system for trusted code.

I have not found a way to automatically send [Yes] by a macro. I have not
been able to set up a format where I provide the [Yes] key in advance.

I know this is designed to stop virus writers from sending emails without my
permission. Do I need to install direct mailer software to go around this
popup?

I am angered when Microsoft presumes to protect me from myself. The software
does not intuitively allow you to trust yourself. No doubt XP will be less
subject to viruses, but it also now stops me from being as productive as I
was under Windows 98.
 
W

Walek

Try this out

'Function send
Public Function Mailer(SendTo As String, SendFrom As String, SendBCC As
String, Sender As String, _
Subject As String, Body As String, IsHTML As Boolean, Attach As
Boolean, AttPath As String, _
ReqRec As Boolean, FName As String)


' Following references needs to be enabled
'Microsoft ActiveX Data Objects 2.5 Library
'Microsoft CDO for Windows 2000 Library

Dim iMsg As New CDO.Message
Dim iBp As CDO.IBodyPart
Dim Flds As ADODB.Fields
Dim rst As ADODB.Recordset
Dim czas As Date


Dim cos As String
Dim iConf As New CDO.Configuration

Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "Your SMTP server"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous
'there are also different auth methods check msdn for details



Flds.Update

With iMsg
Set .Configuration = iConf

.To = SendTo
.From = SendFrom
.BCC = SendBCC
.Sender = Sender
.Subject = Subject
If IsHTML = True Then
.HTMLBody = Body
Else
.TextBody = Body
End If
If ReqRec = True Then
.MDNRequested = True
End If

If Attach = True Then
Set iBp = .AddAttachment(AttPath & FName)
iBp.ContentMediaType = "text/html"
End If

.Send
End With

End Function

Of course you can dialog message to set attachment.
This method leaves no copy of sent item in outlook so you shoud use bcc
to send a copy to user that is originating sending

Regards
Walek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top