Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub SendMail()
Dim oOl As Outlook.Application
Dim oItem As MailItem
On Error GoTo SendMail_Err
Set oOl = New Outlook.Application
Set oItem = oOl.CreateItem(olMailItem)
With oItem
.To = "6021134"
.Body = "my big chicin awli"
.Send
End With
Tidy_Up:
Set oItem = Nothing
Set oOl = Nothing
Exit Sub
SendMail_Err:
MsgBox Err.Description, vbCritical, "Error: " & Err.Number
End Sub
Private Sub sendemail(regno As String, unitname As String, surname1 As String, initial1 As String, course1 As String, location1 As String, date1 As String, traincost As Currency, travelcost As Currency, rowno As Long)
Dim objol As New Outlook.Application
Dim objmail As MailItem
On Error GoTo SendMail_Err
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.To = "someone@someplace.net.au" 'enter in here the email address
.Subject = "Funds Register Update"
.Body = Application.UserName & " has updated row " & rowno & " as follows:" & vbCrLf & _
"Registration Number: " & regno & vbCrLf & _
"Business Unit: " & unitname & vbCrLf & _
"Surname: " & surname1 & vbCrLf & _
"Initials: " & initial1 & vbCrLf & _
"Course Details: " & course1 & vbCrLf & _
"Location: " & location1 & vbCrLf & _
"Dates: " & date1 & vbCrLf & _
"Training Cost: " & traincost & vbCrLf & _
"Travel Cost: " & travelcost & vbCrLf
.DeleteAfterSubmit = True
.NoAging = True
' .Attachments.Add PathName
.Display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True 'send the email without security checking
Exit Sub
SendMail_Err:
DoEvents
End Sub
SendKeys "%{s}", True
SendKeys "{ESC}", True
SendKeys "%{y}", True
[COLOR=red]
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long[/color]
Private Sub sendemail(regno As String, unitname As String, surname1 As String, initial1 As String, course1 As String, location1 As String, date1 As String, traincost As Currency, travelcost As Currency, rowno As Long)
Dim objol As New Outlook.Application
Dim objmail As MailItem
Dim win_wnd As Long
On Error GoTo SendMail_Err
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.To = "someone@someplace.net.au"
.subject = "Funds Register Update"
.body = Application.UserName & " has updated row " & rowno & " as follows:" & vbCrLf & _
"Registration Number: " & regno & vbCrLf & _
"Business Unit: " & unitname & vbCrLf & _
"Surname: " & surname1 & vbCrLf & _
"Initials: " & initial1 & vbCrLf & _
"Course Details: " & course1 & vbCrLf & _
"Location: " & location1 & vbCrLf & _
"Dates: " & date1 & vbCrLf & _
"Training Cost: " & traincost & vbCrLf & _
"Travel Cost: " & travelcost & vbCrLf
.DeleteAfterSubmit = True
.NoAging = True
' .Attachments.Add PathName
.Display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
[COLOR=red]
' Look for the the "Spelling" window
win_wnd = FindWindow("#32770", "Spelling")
' If the "Spelling" window is found, ...
If win_wnd <> 0 Then
SendKeys "{ESC}", True
SendKeys "%{y}", True
End If
[/color]
Exit Sub
SendMail_Err:
DoEvents
End Sub