Wednesday, November 26

Total. Vb. Pwnage. Look. Right. Here.

The sole greatest thing I have ever done. Period.

Option Explicit
Dim body
Dim email

Sub Export_Outlook()

email = InputBox("Please put in recipients email address")

body = Range("A1:D4")

Dim oOutlook As Outlook.Application

Set oOutlook = CreateObject("Outlook.Application")

Dim oNamespace As Namespace

Set oNamespace = oOutlook.GetNamespace("MAPI")

oNamespace.Logon

Dim oMailFolder As MAPIFolder

Set oMailItem = oOutlook.CreateItem(olMailItem)

With oMailItem

.To = email

.Subject = "Quote"

.body = body

.Send

End With

oNamespace.Logoff

End Sub

No comments: