[AccessD] Outlook's annoying habits

davesharpe2 at cox.net davesharpe2 at cox.net
Tue Apr 29 10:01:13 CDT 2003


----- Original Message ----- 
From: John W. Colby 
To: AccessD 
Sent: Monday, April 28, 2003 8:43 AM
Subject: [AccessD] Outlook's annoying habits


I have a database that needs to send emails every day with attached docs.
With all SPs applied, Outlook insists on stopping the process and forcing
the user to confirm the send.  Is there any way to turn off this annoying
process?

John W. Colby
Colby Consulting
www.ColbyConsulting.com
 
*******************************************************
 
John - I'm not sure of the significance of "With all SPs applied".
 
I'm Office2000 not sure of SP level. I use the following
( I found the basic format somewhere, sometime ago ). It
works for me without any prompting, I hope that It might 
help you.
 
Dave
 
********************************************************
 
 
Function Send_To_Them(TheFile As String)
 
Dim CheckOutlook As Boolean
DoCmd.Hourglass True
 
 
Dim The_Subj As String
The_Subj = "Here is the weekly VINA data"
 
Dim B_B As String
B_B = "Folks, attached is the VINA current as of moments ago." & vbCrLf & vbCrLf
 
B_B = B_B & vbCrLf
B_B = B_B & "Dave Sharpe" & vbCrLf
 

 Dim objOutlook As Outlook.Application
 Dim objOutlookMsg As Outlook.MailItem
 Dim objOutlookRecip As Outlook.Recipient
 Dim objOutlookAttach As Outlook.Attachment
 
 ' 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.
    Set objOutlookRecip = .Recipients.Add("_vina_real")
    objOutlookRecip.Type = olTo
 
    ' Add the BCC recipient(s) to the message.
     Set objOutlookRecip = .Recipients.Add("_mee")
     objOutlookRecip.Type = olBCC
 
    ' Set the Subject, Body, and Importance of the message.
    .Subject = The_Subj
    .Body = B_B
    .Importance = olImportanceHigh  'High importance
 
    ' Add attachments to the message.
    If Not IsMissing(TheFile) Then
        Set objOutlookAttach = .Attachments.Add(TheFile)
    End If
 
    ' Resolve each Recipient's name.
    For Each objOutlookRecip In .Recipients
        objOutlookRecip.Resolve
    Next
 
    ' Should we look at the message in Outlook before sending?
    If CheckOutlook Then
        .Display
    Else
        .Save
        .Send
    End If
 End With
 Set objOutlook = Nothing
 DoCmd.Hourglass False
End Function
 
'========================================================================
'========================================================================
 



More information about the AccessD mailing list