Send Object Method

G

Guest

i have the following code

Private Sub ReportAFaultPB_Click()
On Error GoTo Err_ReportAFaultPB_Click

Dim var1 As Variant
Dim var2 As Variant
Dim var3 As Variant
Dim var4 As Variant
Dim var5 As Variant

var1 = DLookup("[CompanyName1]", "Our Company Info")
var2 = DLookup("[cAddress]", "Our Company Info")
var3 = DLookup("[PhoneNumber]", "Our Company Info")
var4 = DLookup("[Database]", "Database Information")
var5 = DLookup("[Revision]", "Database Information")

DoCmd.SendObject acSendNoObject, , , "myemailaddress", , , "Report A
Fault", "Your Database Details" & vbCrLf & vbCrLf & var1 & vbCrLf & var2 &
vbCrLf & var3 & vbCrLf & var4 & vbCrLf & var5 & vbCrLf & vbCrLf & "Type Your
Fault Below"

Exit_ReportAFaultPB_Click:
Exit Sub

Err_ReportAFaultPB_Click:
MsgBox Err.Description
Resume Exit_ReportAFaultPB_Click

End Sub


When my new email opens in outlook it all works fine but you can edit the
edit message part of the send oblect method. can i stop the user from editing
this text but still be able to add text to the email before sending it.
 
D

Dirk Goldgar

StuJol said:
i have the following code

Private Sub ReportAFaultPB_Click()
On Error GoTo Err_ReportAFaultPB_Click

Dim var1 As Variant
Dim var2 As Variant
Dim var3 As Variant
Dim var4 As Variant
Dim var5 As Variant

var1 = DLookup("[CompanyName1]", "Our Company Info")
var2 = DLookup("[cAddress]", "Our Company Info")
var3 = DLookup("[PhoneNumber]", "Our Company Info")
var4 = DLookup("[Database]", "Database Information")
var5 = DLookup("[Revision]", "Database Information")

DoCmd.SendObject acSendNoObject, , , "myemailaddress", , ,
"Report A Fault", "Your Database Details" & vbCrLf & vbCrLf & var1 &
vbCrLf & var2 & vbCrLf & var3 & vbCrLf & var4 & vbCrLf & var5 &
vbCrLf & vbCrLf & "Type Your Fault Below"

Exit_ReportAFaultPB_Click:
Exit Sub

Err_ReportAFaultPB_Click:
MsgBox Err.Description
Resume Exit_ReportAFaultPB_Click

End Sub


When my new email opens in outlook it all works fine but you can edit
the edit message part of the send oblect method. can i stop the user
from editing this text but still be able to add text to the email
before sending it.

No, not once it's open for editing in your mail program -- then it's
fair game. But you could give them a text box on a form to enter
additional text, then you could pick up that text from the form and
append it to the message body you pass to SendObject.

You're aware that you don't have to allow them to edit the e-mail,
right? You can set the EditMessage argument to False to have the
message sent immediately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top