Link to home
Start Free TrialLog in
Avatar of jrameuwissen
jrameuwissen

asked on

Unable to create object Redemption.SafeMailItem

Dear Experts,

I have a problem using automated emailing out of ms access to ms outlook 2003.
When i try to send an email using Redemption.SafeMailItem, Access return an error message that the ActiveX is unbale to create the object.

I use attached code.
Any ideas?

Thanks in advance

Dim ObjOutlook As Outlook.Application
        Dim objOutlookMSG As Outlook.MailItem
        Dim objOutlookRecip As Outlook.Recipient
        Dim objOutlookAttach As Outlook.Attachment
        Dim objSafeMail As Object
        ' Create the Outlook session.
        Set ObjOutlook = CreateObject("Outlook.Application")
        ' Create the message.
        Set objOutlookMSG = ObjOutlook.CreateItem(olMailItem)
        With objOutlookMSG
            .Subject = strSubject
            .Body = strMessage
            If strAttach <> "" Then
                Set objOutlookAttach = .Attachments.Add(strAttach)
            End If
            .To = strTo
            .CC = strCC
            .BCC = strBCC
            If blnHighImportance = True Then
                .Importance = olImportanceHigh
            End If
            If blnFlagEmail = True Then
                .FlagStatus = olFlagMarked
            End If
        End With
        'Passes the Outlook Message to Redemption to Bypass security prompts.
        objOutlookMSG.Save
        Set objSafeMail = CreateObject("Redemption.SafeMailItem")
        Set objSafeMail.item = objOutlookMSG
        objSafeMail.Recipients.Add strTo
        objSafeMail.Send

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jrameuwissen
jrameuwissen

ASKER

Gents,

Thanks for your response.
The debugger jumped to line Set objSafeMail = CreateObject("Redemption.SafeMailItem").
I reinstalled an up to date version of Redemption and now I do not receive the errormessage anymore.
The only issue remaining is when I open Outlook, the message is stored in concepts and is not send automaticly..

Thanks
Gents,

Thanks for your responses. I was able to fix the problem by reconfiguring my email account.
Split point for your responses.

Thanks for trying!

Regards, Johan
Glad to help :)