Add email button - Access 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add a button on the form that just opens a new email, pre-filled
with an email address from a field also in the same form. Can someone PLEASE
walk me through this? Much appreciated! Thanks.
 
On the OnClick event of the button run this code
===================================
Dim spObj As Object, objItem As Object
Set spObj = CreateObject("Outlook.Application")

Set objItem = spObj.CreateItem(olMailItem)
objItem.Display
Set spObj = Nothing
===================================
 
Ofer said:
docmd.SendObject acSendNoObject

Thanks - it does indeed open a new mail window, but two problems.

1) I need it to fill in the TO field from a database field in the record.
(in this case the field is called, 'Program Contact')

2) It opens the Virtual Basic debugger and says, "Run-time error '2501': The
SendObject action was canceled."
 
Dim AddressName As String
AddressName = "(e-mail address removed)"
docmd.SendObject acSendNoObject,,,AddressName

Replace in the Addressname the field value
 
Back
Top