Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send mail with cell contents

Status
Not open for further replies.

rephlex

Technical User
Aug 15, 2001
35
GB
Hi,

I want to have hyperlinks on a spreadsheet which when clicked send a mail with the contents of a cell (or two) in either the body or subject
=hyperlink(mailto:xxxxx@xxxx.com?subject=cell")
how do I pull out the contents of a cell
is there a better way of doing it??
 
hi,

You can do it without a hyperlink, using the Dialogs Method. The code is...
Code:
   With Application.Dialogs(xlDialogSendMail)
      .Show "somename@node", [D4], True
   End With
where there are 3 argments...
1. recipients,
2. subject,
3. return_receipt

This code could be executed via a Worksheet_SelectionChange event for that sheet object.

Hope this helps ;-)
Skip,
 
I like that SkipVought!!
Just one small fly in the ointment - I dont want to actually send the spreadsheet, just the contents of a cell (can I add more than one cell & can I put any info in the body??)
 
just a bounce - please see previous post
 
bounce again

I like that SkipVought!!
Just one small fly in the ointment - I dont want to actually send the spreadsheet, just the contents of a cell (can I add more than one cell & can I put any info in the body??)

Anybody any ideas???
 
You can do this from within outlook using vba.
See example that follows

Public Sub ReadExcelOutEmail()
Dim RetVal, Ans6
Dim myOLApp As Outlook.Application
Dim myitem As Outlook.MailItem
Dim exlApp As Object, objResultsSheet As Object, objWorkBook As Object
'***************************************************************************************
' this is simply taking what is on the excel spreadsheet and putting the figures onto
' the body of an e-mail that is sent to Melissa
'****** this is not being used in this project we are using the form ******
'***************************************************************************************
' opens excel application
RetVal = Shell("c:\Program Files\Microsoft Office\Office\Excel.exe", 0)

' creates object
Set exlApp = CreateObject("Excel.Application")

' set the library
Set exlApp = GetObject("c:\firestone\Melissa.xls")
'exlApp.Parent.Windows(1).Visible = True
'exlApp.Application.Visible = False
Set objResultsSheet = exlApp.worksheets(1)
exlApp.Application.ScreenUpdating = False
exlApp.Application.DisplayAlerts = False

' here is the info from a cell
Ans6 = objResultsSheet.Range("A1").Value

exlApp.Application.Save

Set myOLApp = New Outlook.Application

' Creates a new MailItem form
Set myitem = myOLApp.CreateItem(olMailItem)

' Set the "To" field
myitem.To = "flagisup@ix.netcom.com"
myitem.Subject = "Survey"
myitem.Body = "This is the results " & Ans6 & Chr(10) & "This is the results " & Ans6
' Display the item
myitem.display

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top