Email subform through outlook

acarterczyz

Registered User.
Local time
Today, 06:37
Joined
Apr 11, 2013
Messages
68
Hey all!

I've been messing around with this for some time and I can't seem to get it to work. I'm trying to make it so when a subform is updated, it will email the contents of that subform to me. I've got it all working, except for the content of the email part. Any ideas on how I can implement this?

Code:
Sub SendRepReassignment()
Dim oOutlook As Outlook.Application
Dim oEmailItem As MailItem
Dim objOutlookAttach As Outlook.Attachment
On Error Resume Next
Err.Clear
Set oOutlook = GetObject(, "Outlook.application")
If Error.Number <> 0 Then
Set oOutlook = New Outlook.Application
End If

Set oEmailItem = oOutlook.CreateItem(olMailItem)
With oEmailItem
.to = "[B]my email address[/B]"
.Subject = "[B]Subject Line of Email[/B]"
[B]This is the part I'm stuck on[/B]

.Display
End With
Set oEmailItem = Nothing
Set oOutlook = Nothing
End Sub

Code:
Private Sub SaveSend_Click()
Call SendRepReassignment
End Sub
 
In general, presuming the code is behind the subform:

.Body = "Whatever text is desired " & Me.TextboxName

Using a string variable if it gets more complicated.
 
In general, presuming the code is behind the subform:

.Body = "Whatever text is desired " & Me.TextboxName

Using a string variable if it gets more complicated.

Thanks for your reply, but its a subform I want to attach in the body, not a textbox.
 

Users who are viewing this thread

Back
Top Bottom