I've pasted some code that I am using currently in my db. This code is behind
one of my forms. When I fire this in A2000 I get no warning message from
Outlook. When I fire it in A2003 I get the warning message. I'm using "Click
Yes" to get around this in 2003. This is what I tested in A2007 and got no
warning message.
Sub SendMessageGenerateTicket(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim db As Database
Dim rsEmail As Recordset
Dim stTo, stFrom, stCC, stBCC, stSubject, stSal, stText As String
Dim stQuery As String
Dim stAttachPath As String
stSubject = "RMA#: " & Forms![2005 Form]!RMA
stText = "The Disposition for the RMA noted in the subject line has been
completed. Please generate an 'R' ticket. The original WO# is: " &
Forms![2005 Form]![WO # - Line #]
'Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
'Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = Forms![2005 Form]![GenerateTicket].Column(2)
.Subject = stSubject
.Body = stText
.Importance = olImportanceNormal ' Normal Importance
.Send
'Next
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Tom Wickerath said:
Here's one way, but I was making the assumption that you are using the
SendObject method, which may not be the case. Type "DoCmd.SendObject"
(without the quotes) into a procedure. Then select this word and press the F1
button to open context-sensitive Help. You should see the following:
The SendObject method carries out the SendObject action in Visual Basic.
expression.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc,
Subject, MessageText, EditMessage, TemplateFile)
and
EditMessage Optional Variant. Use True (–1) to open the electronic mail
application immediately with the message loaded, so the message can be
edited. Use False (0) to send the message without editing it. If you leave
this argument blank, the default (True) is assumed.
So, if you left this argument blank, you'd get True, which should result in
the message being opened in Outlook and available for you to edit (requires
you to press the Send button).
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________