Access Redemption Outlook

kidrobot

Registered User.
Local time
Today, 11:28
Joined
Apr 16, 2007
Messages
409
I have a macro that sends out e-mails and when the e-mails are sent out there is a warning that says something like "a prgram is trying to automatically send an e-mail on your behalf. Do you want to allow this?"... I want to use redemption to make this stop. can anyone provide the modules/code so I can get this done?

ps. the only examples i've found are people creating an e-mail in their code, I have a macro that has everything set up to send out the e-mail.
 
Last edited:
I have this code in another database to create the report through VBA, but I have everything running in a macro... how can I just make the warning stop when I run my Macro that uses SendObject!?!?

Code:
Option Compare Database

Public Function Email(strTo As String, _
                      strCc As String, _
                      strBcc As String, _
                      strSubject As String, _
                      strBody As String, _
                      strAttachment As String)

                      
   Dim objOutlook As Outlook.Application
   Dim objOutlookMsg As Outlook.MailItem
   Dim objOutlookRecip As Outlook.Recipient
   Dim objOutlookAttach As Outlook.Attachment
   Dim objSaveMail As Redemption.SafeMailItem

   On Error GoTo ErrorMsgs

   ' Create the Outlook session.
   Set objOutlook = CreateObject("Outlook.Application")
   ' Create the message.
   Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   With objOutlookMsg
        .Subject = strSubject
        '.To = ""
        .To = strTo
        .CC = strCc
        .BCC = strBcc
        .Body = strBody
      
 
   '  Set objOutlookRecip = .Recipients.Add("")
'      objOutlookRecip.Type = olTo
      ' Add the CC recipient(s) to the message.
'      objOutlookRecip.Type = olCC
      ' Set the Subject, Body, and Importance of the message.
'      .Subject = "This is an Automation test with Microsoft Outlook"
'      .Body = "Last test." & vbCrLf & vbCrLf
     ' .Importance = olImportanceHigh  'High importance
      ' Add attachments to the message.
           If Not IsNull(strAttachment) And strAttachment <> "" Then   'if there's an attachment add it
       objOutlookMsg.Attachments.Add strAttachment, , , Left$(strAttachment, 25)
     End If
    '  If Not IsMissing(AttachmentPath) Then
     '    Set objOutlookAttach = .Attachments.Add(AttachmentPath)
      ' End If
      ' Resolve each Recipient's name.
   '   For Each objOutlookRecip In .Recipients
   '      If Not objOutlookRecip.Resolve Then
   '         objOutlookMsg.Display

  '    End If
     ' Next
     Set objSafeMail = New Redemption.SafeMailItem
     objSafeMail.Item = objOutlookMsg
     objSafeMail.Send
     
   End With
   Set objOutlookMsg = Nothing
   Set objOutlook = Nothing
   Set objOutlookRecip = Nothing
   Set objOutlookAttach = Nothing
ErrorMsgs:
   If Err.Number <> "0" Then
      MsgBox Err.Number & Err.Description
   End If
End Function
 
Last edited:
Using sendobject you will (as far as I know) always get the warning message.

You have working code allready right? So it is a small matter of changing the attachment or??
 
thanks namliam, i guess all i needed to know is if i could use sendobject. that code is from another database.
 

Users who are viewing this thread

Back
Top Bottom