Charlotte Foust
cfoust at infostatsystems.com
Wed Jun 29 19:11:28 CDT 2005
Well, I DID wonder! LOL
What exactly are you trying to do with the Application.CreateItem line? The SafeItem object has a text property for the message body. And do you have CDO enabled in Outlook? You need it for early binding a MAPI session. Then you can do something like this:
Dim objMAPI as MAPI.Session
Dim objMessage as MAPI.Message
Dim objRecipient as MAPI.Recipient
Then down the line, you can do:
SafeItem.Item = objMessage
SafeItem.Text = "This is my message"
Charlotte Foust
-----Original Message-----
From: Christopher Hawkins [mailto:clh at christopherhawkins.com]
Sent: Wednesday, June 29, 2005 4:43 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] re: Using Outlook Redemption in Access
Wait, I sent the wrong code snippet. here is the one I am using:
[code]
Private Sub Blah()
Dim SafeItem, oItem
Set Application = CreateObject("Outlook.Application")
Set Namespace = Application.GetNamespace("MAPI")
Namespace.Logon
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "clh at christopherhawkins.com"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send
End Sub
[/code]
Alright, NOW you can tell me what you think. :)
-C-
----------------------------------------
From: "Christopher Hawkins" <clh at christopherhawkins.com>
Sent: Wednesday, June 29, 2005 5:39 PM
To: accessd at databaseadvisors.com
Subject: Using Outlook Redemption in Access
If you've ever made an Access app that sends eMail, you might be familiar with Outlook Redemption (http://www.dimastr.com/redemption/). It is a set of COM components that allow you to bypass that messy Outlook dialog that reads "A program is trying to automatically send e-mail on your behalf. Do you want to allow this?" blah blah blah.
I just downloaded Redemption and am unab;e to get it to work. I'm hoping that someone who has successfully implemented it can help me here.
I am using code straight from the Redemption site (http://www.dimastr.com/redemption/objects.htm):
[CODE]
Private Sub Blah()
Dim SafeItem, oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "clh at christopherhawkins.com"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send
End Sub
[/CODE]
This code is triggered form a button click on a form.
When I run the code, I get an error message:
"Method or data member not found"
The error is on the .CreateItem method in the line that sets oItem to a new item.
I've double-checked that the Redemption dll is registered, and I've made sure it is referenced in the Access file. I suspect that there is some simple aspect of setup that I'm overlooking.
Anybody ever have this same issue?
-C-
--
AccessD mailing list
AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com