By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,208 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,208 IT Pros & Developers. It's quick & easy.

Re: MSAccess Runtime Error

P: n/a
On Thu, 30 Oct 2008 11:04:44 GMT, "JOHNNY OUTING" <ou******@att.net>
wrote:

You managed to violate several netiquette rules in one post. Please
review http://www.mvps.org/access/netiquette.htm
This is a text-only newsgroup (you could have captured the error
message with Ctrl+C), and if you can't be bothered to check back for
messages, why would we make the effort to answer in the first place?

RunCode is designed to call a public FUNCTION, not a sub.

Also make sure you check the results of CreateObject; don't assume it
works:
if appOutlook is nothing then
Msgbox "Aarrrrcchhh, Outlook not installed?"
else
Set MailOutlook... etc.
end if

..To takes a string, like "mailbox@domain"

-Tom.
Microsoft Access MVP

>Below is a sample code that processes an Email using Microsoft Outlook in the background. From this code I've done the following:
a.. The database it is incorporated into is a MSAccess '97 multi-user secured database that is used in a Citrix Environment
b.. I've incorporated this code into a Module.
a.. From the Menu in the Design view of this module, I select --Tools --References --"Microsoft Outlook 8.0 Object Library"
c.. From the command button on one of my Forms, it processes a macro using "Runcode" TestMail ().
d.. When I test the code using the command button it works for me
e.. I've given the other users permission to the module where the code is stored but the code only works for me and not the other users
a.. NOTE: prior to me using this "Runcode", I used the macro "SendMail" and it works for all the users
The problem is when the other users try using this same command button that processes this module by using the macro "Runcode" - testmail(), it gives the following run-time error message: "Run-time error '-2147287035 (80030005)': You don't have appropriate permission to perform this operation." HELP!!!!!!!!
P.S. When you post to your newsgroup, please also reply to this email address as well: jo**************@boeing.ksc.nasa.gov

Thanks
--------------------------------------------------------------------------------

'================================================ ==========

Public Sub TestMail()

Dim appOutLook As Object

Dim MailOutLook As Object

Dim strMSG As String

Set appOutLook = CreateObject("Outlook.Application")

Set MailOutLook = appOutLook.CreateItem(olMailItem)

strMSG = "How are you, my friend!"

With MailOutLook

.To = mailbox@domain

.Subject = "hello"

.Body = strMSG

.Send

End With

Set appOutLook = Nothing

End Sub

'================================================ ============


Oct 30 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I implemented the code as you requested but it still gives a runtime error
for the other users. It works for me but not the other users.

--
JOHNNY OUTING
"Tom van Stiphout" <to*************@cox.netwrote in message
news:88********************************@4ax.com...
On Thu, 30 Oct 2008 11:04:44 GMT, "JOHNNY OUTING" <ou******@att.net>
wrote:

You managed to violate several netiquette rules in one post. Please
review http://www.mvps.org/access/netiquette.htm
This is a text-only newsgroup (you could have captured the error
message with Ctrl+C), and if you can't be bothered to check back for
messages, why would we make the effort to answer in the first place?

RunCode is designed to call a public FUNCTION, not a sub.

Also make sure you check the results of CreateObject; don't assume it
works:
if appOutlook is nothing then
Msgbox "Aarrrrcchhh, Outlook not installed?"
else
Set MailOutlook... etc.
end if

.To takes a string, like "mailbox@domain"

-Tom.
Microsoft Access MVP

>>Below is a sample code that processes an Email using Microsoft Outlook in
the background. From this code I've done the following:
a.. The database it is incorporated into is a MSAccess '97 multi-user
secured database that is used in a Citrix Environment
b.. I've incorporated this code into a Module.
a.. From the Menu in the Design view of this module, I select -->
Tools --References --"Microsoft Outlook 8.0 Object Library"
c.. From the command button on one of my Forms, it processes a macro
using "Runcode" TestMail ().
d.. When I test the code using the command button it works for me
e.. I've given the other users permission to the module where the code
is stored but the code only works for me and not the other users
a.. NOTE: prior to me using this "Runcode", I used the macro
"SendMail" and it works for all the users
The problem is when the other users try using this same command button
that processes this module by using the macro "Runcode" - testmail(), it
gives the following run-time error message: "Run-time error '-2147287035
(80030005)': You don't have appropriate permission to perform this
operation." HELP!!!!!!!!
P.S. When you post to your newsgroup, please also reply to this email
address as well: jo**************@boeing.ksc.nasa.gov

Thanks
--------------------------------------------------------------------------------

'=============================================== ===========

Public Sub TestMail()

Dim appOutLook As Object

Dim MailOutLook As Object

Dim strMSG As String

Set appOutLook = CreateObject("Outlook.Application")

Set MailOutLook = appOutLook.CreateItem(olMailItem)

strMSG = "How are you, my friend!"

With MailOutLook

.To = mailbox@domain

.Subject = "hello"

.Body = strMSG

.Send

End With

Set appOutLook = Nothing

End Sub

'=============================================== =============



Oct 30 '08 #2

P: n/a
On Thu, 30 Oct 2008 18:00:10 GMT, "JOHNNY OUTING" <ou******@att.net>
wrote:

I have no other suggestions, but I noticed your email address has the
nasa.gov domain, which in my imagination means a more-than-average
secured environment, so perhaps the error message is true: the user
does not have programmatic rights to perform this operation.

Btw another besides-the-point observation: if you set a reference to
Outlook, you are using "early binding", whereas your code snippet uses
"late binding" which does not make sense.

-Tom.
Microsoft Access MVP

>I implemented the code as you requested but it still gives a runtime error
for the other users. It works for me but not the other users.
Oct 31 '08 #3

P: n/a
Thanks for sharing your expertise!

--
JOHNNY OUTING
"Tom van Stiphout" <to*************@cox.netwrote in message
news:sh********************************@4ax.com...
On Thu, 30 Oct 2008 18:00:10 GMT, "JOHNNY OUTING" <ou******@att.net>
wrote:

I have no other suggestions, but I noticed your email address has the
nasa.gov domain, which in my imagination means a more-than-average
secured environment, so perhaps the error message is true: the user
does not have programmatic rights to perform this operation.

Btw another besides-the-point observation: if you set a reference to
Outlook, you are using "early binding", whereas your code snippet uses
"late binding" which does not make sense.

-Tom.
Microsoft Access MVP

>>I implemented the code as you requested but it still gives a runtime error
for the other users. It works for me but not the other users.

Nov 5 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.