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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending an email with the excel sheet as the email bodynot as attachm

Status
Not open for further replies.

suha

Programmer
Aug 19, 2000
41
0
0
JO
hello

i'm working on an excel sheet and i want to create a command button with a macro to Send single sheet as message body , can anyone help in writing this visual basic macro (especially sheet as message body).

Public Sub SendMailMessage()
Dim mailAddress As String
Dim Subject As String
' Set myAttachments = olItem.Body
' myAttachments.Add (active.Sheet)
Dim olApp As Object, olItem As Object

Set olApp = CreateObject("Outlook.Application")
Set olItem = olApp.CreateItem(olMailItem)
olItem.Recipients.Add "smajid@roamman.com.jo"
olItem.Subject = "Some Subject"
olItem.Body =??????(i want activesheet)?????
olItem.DeleteAfterSubmit = True
olItem.OriginatorDeliveryReportRequested = False
olItem.ReadReceiptRequested = False
olItem.display
'OpenEmail = True
End Sub


please help

suha
 
I may be wrong but I think you'll find that the supported media types for message bodies are Text and HTML. I suspect that you may be stuck sending it as an attachment.

However, you may want to consider sending a HTML <A HREF> tag in the body that when clicked will load the applicable sheet.
William
Software Engineer
ICQ No. 56047340
 
no i don't need html ref only i only need to write the macro in visual basic.

so please help.

suha
 
hello again
can anyone help me to find out how i can send the selected sheet as the e-mail body not as an attachment.

suha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top