Hi All,
i've looked this forum for working code to send current form via email, but nothing seems to work for me, i did manage to find code what did work to send email when i click button on the form, but there is no code in it to save current form and send that.
this is the code i found, is there a way to add more code to this to get it to send current form?
Private Sub eMail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
If Err Then 'Outlook is not open
Set olApp = CreateObject("Outlook.Application") 'Create a new instance of Outlook
End If
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.To = "myemail@mywebsite.co.uk"
.Subject = "Task Assigned"
.HTMLBody = "Text"
.send
End With
MsgBox "Operation completed successfully"
End Sub
thanks
peter
i've looked this forum for working code to send current form via email, but nothing seems to work for me, i did manage to find code what did work to send email when i click button on the form, but there is no code in it to save current form and send that.
this is the code i found, is there a way to add more code to this to get it to send current form?
Private Sub eMail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
If Err Then 'Outlook is not open
Set olApp = CreateObject("Outlook.Application") 'Create a new instance of Outlook
End If
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.To = "myemail@mywebsite.co.uk"
.Subject = "Task Assigned"
.HTMLBody = "Text"
.send
End With
MsgBox "Operation completed successfully"
End Sub
thanks
peter