D
Dave Couch
I am using Outlook 2003 and the code given in the Office artilce "Using
automation in Access to work with Outlook 2003. I am sending a simple email
to a given recipient. I am trying to get rid of the "permission" pop up. I
have downloaded and installed the "Redemption" software and added it to the
module. However, I am very ignorant of how to add/modify the code to use the
redemption code. Can some one help. Here is the code I am currently using.
Sub sbSendMessage()
Dim objoutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
'On Error GoTo ErrorMsgs
' Create the Outlook session.
Set objoutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objoutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message. Substitute
' your names here.
Set objOutlookRecip = .Recipients.Add("Heidi")
objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message.
' Set the Subject, Body, and Importance of the message.
.Subject = "New Client Added"
.Body = "A new client has been added to the work order list." & vbCrLf
& vbCrLf
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send
End With
Set objOutlookMsg = Nothing
Set objoutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
'ErrorMsgs:
'If Err.Number = "287" Then
'MsgBox "You clicked No to the Outlook security warning. "
'Else
'MsgBox Err.Number, Err.Description
'End If
End Sub
automation in Access to work with Outlook 2003. I am sending a simple email
to a given recipient. I am trying to get rid of the "permission" pop up. I
have downloaded and installed the "Redemption" software and added it to the
module. However, I am very ignorant of how to add/modify the code to use the
redemption code. Can some one help. Here is the code I am currently using.
Sub sbSendMessage()
Dim objoutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
'On Error GoTo ErrorMsgs
' Create the Outlook session.
Set objoutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objoutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message. Substitute
' your names here.
Set objOutlookRecip = .Recipients.Add("Heidi")
objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message.
' Set the Subject, Body, and Importance of the message.
.Subject = "New Client Added"
.Body = "A new client has been added to the work order list." & vbCrLf
& vbCrLf
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send
End With
Set objOutlookMsg = Nothing
Set objoutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
'ErrorMsgs:
'If Err.Number = "287" Then
'MsgBox "You clicked No to the Outlook security warning. "
'Else
'MsgBox Err.Number, Err.Description
'End If
End Sub