Send object Help

james_halliwell

Registered User.
Local time
Today, 00:00
Joined
Feb 13, 2009
Messages
211
Hi All,

Is it possible to use the sendobject macro but not have is as an attachement but show the form in the body of the mail message
I have a form which shows single records which i would like to email to a certain person but show the record in the form view not as an attachment but in the body of the email

Thanks
 
James take a look at the code below I use this to get new users to register for access to a database. You will have to set the References to Outlook via the VBA Screen and you could then adjust this to use form controls for the body of the email.

Sub sendForApproval()
'*************************************************
'VBA Code created by Trevor G
'*************************************************
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "enter a email address here"
.Subject = "Access Request"
.Body = "Please can you provide access to the Database system." & vbCr & vbCr & _
"The required details are as follows my Full Name is: " & vbCr & _
"My User ID is: " & vbCr & _
"My Computer Name is: "
.Display

End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
 
Sub sendForApproval()
'*************************************************
'VBA Code created by Trevor G
'*************************************************
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "enter a email address here"
.Subject = "Access Request"
.Body = "Please can you provide access to the Database system." & vbCr & vbCr & _
"The required details are as follows my Full Name is: " & vbCr & _
"My User ID is: " & vbCr & _
"My Computer Name is: "
.Display

End With
Set olMail = Nothing
Set olApp = Nothing
End Sub[/quote]

Hi trevor,
Thanks for your reply, you will have to excuse me but vba isnt my strong point i can only open and close forms...lol thats why i used the sendobject would it be the Body = [Form name] some thing like that

Its like a confirmation email fo the form shows the current record

many thanks
 
The body is the place to use this, but you would have to work on each control in your form sadly. It would take a little working out or perhaps you could look at sending the form into Excel and Excel can be the body of your email.

1 question though what happens if you are sending to people who don't have Outlook as there email system?
 
Hi Trevor I will be only sending to around 20 people who I know have microsoft office install on there laptops but arnt the best (bit like me)

just thinking could I put it as a PDF but show it in the body

how would it be achived

Many thanks for getting back to me and being patient
 
If you want to use PDF in the body James, you have to have some kind of conversion software, not free sadly. Here is a link to a download option.

http://www.pdfkit.com/pdf-export-kit.htm

How often are you sending out emails ?

What about my first option that I sent to you, can you adapt the code to include the field names in the body area and play around with the look of it?

What about the second suggestion about sending the report (form contents) into an excel workbook or word document then that can become the body of the email?
 

Users who are viewing this thread

Back
Top Bottom