Is it possible to create a command button that sends e-mail

Sato

Registered User.
Local time
Today, 15:52
Joined
Feb 27, 2003
Messages
14
Hi,
Is it possible to create a command button (or a field) that opens the e-mail application and sends a e-mail to to a e-mail adress that is on a field, such as e-mail adress of a record?
For example I have a clients batabase with several recors and in one field i have the e-mail adress of those clients, and i would want to click somewhere to open the e-mail application to send an e-mail.
Thanks.

Sato
 
Hi, I would think it is possible, I accomplished this in Excel so I'll post the VB Code I used so you might be able to get an idea to do something with it.

Sub sendsheet1()
'Declare String
Dim sAddress As String
'Initialise the string with the address entered into box
sAddress = InputBox("Please enter the name of the recipient" & vbCr & "CONVENTION = firstname . surname@thiscompany.co.uk", "Send To")

'If the user doesn't enter an address then exit the sub.
If sAddress = "" Then Exit Sub
' SELECT THE SHEET NAME
Sheets("Automated Invoice").Select ' change name
Range("export1").Select
' Range(Range("A1"), Range("g49").End(xlUp)).Select
Selection.Copy
' if you have multi formatted colums etc ( ie various widths etc) then it is better to create a blank master and load that and then paste to that
Workbooks.Open Filename:="C:\Documents and Settings\excelinvoice.xls"
' Workbooks.Add
' paste the selection
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SendMail Recipients:=sAddress, Subject:="Interglobe Freight Service Invoice", ReturnReceipt:=False
MsgBox "Your email has been sent to" & vbCr & sAddress & vbCr & "", , "MESSAGE"
ActiveWindow.Close SaveChanges:=False
' at this point select no to msgbox and then swithback to original sheet
Sheets("Automated Invoice").Select ' change name
Range("H1").Select
End Sub
 
What email application are you using?

Lookup the SendObject command.
 

Users who are viewing this thread

Back
Top Bottom