Private Sub Command4_Click()
Application.Assistant.AssistWithAlerts = True
Dim olApp As Outlook.Application
Dim olNewMail As Outlook.MailItem
Dim sEmailAddress As String
Dim fso
Dim file As String
Set olApp = New Outlook.Application
Set olNewMail = CreateItem(olMailItem)
With olNewMail
Address = InputBox("Type e-mail address")
.Recipients.Add sEmailAddress
.Subject = "Worksheet Update"
.Body = "Updated worksheet attached."
With .Attachments
.Add "c:\test.doc" 'Attach file (.doc)
End With
'.Save
.Display
'.Send
End With
End Sub
|