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.
Private Sub CommandButton1_Click()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Dim varBody As String
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
varBody = Worksheets("DCC").Range("A1:G25").Activate
With objmail
.To = "Jane.Doe@email.com"
.Subject = "Next Of Kin Information"
.Body = varBody & vbCrLf & "If you have any please email john.doe@email.com" & vbCrLf
.NoAging = True
.Display
End With
Set objmail = Nothing
Set objol = Nothing
End Sub
Private Sub CommandButton1_Click()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Dim varBody As String
[COLOR=red]Dim objdata As DataObject[/color]
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
[COLOR=red]Set objdata = New DataObject[/color]
Worksheets("DCC").Range("A1:G25").[COLOR=red]Copy[/color]
[COLOR=red]objdata.GetFromClipboard[/color]
[COLOR=red]varBody = objdata.GetText[/color]
With objmail
.To = "Jane.Doe@email.com"
.subject = "Next Of Kin Information"
.body = varBody & vbCrLf & "If you have any please email john.doe@email.com" & vbCrLf
.NoAging = True
.Display
End With
Set objmail = Nothing
Set objol = Nothing
End Sub
Set objdata = Nothing
Sub Send_Email()
ActiveWorkbook.EnvelopeVisible = True
ActiveWorkbook.ActiveSheet.Range("A1").Select
' Tweak SendKeys accordingly
' The below considers the TO Field to be three SHIFT+TABS up
SendKeys "+{TAB}" ' SHIFT + TAB
SendKeys "{HOME}+{END}{DEL}" ' Deletes textbox contents
SendKeys "SUBJECT" ' Subject Field?
SendKeys "+{TAB}" ' SHIFT + TAB
SendKeys "{HOME}+{END}{DEL}" ' Deletes textbox contents
SendKeys "" ' CC Field?
SendKeys "+{TAB}" ' SHIFT + TAB
SendKeys "{HOME}+{END}{DEL}" ' Deletes textbox contents
SendKeys "[URL unfurl="true"]www.com"[/URL] ' TO Field?
'SendKeys "%s" ' ALT + S - Sends Email
End Sub
'SendKeys "%s"[COLOR=red], 1[/color]