Crie um formulário com dois botões de comando chamados CommandButton1 e CommandButton2. Em seguida, cole o cóidgo a seguir no seu módulo de formulário:
Dim moMail As Object 'Outlook.MailItem
Private Sub UserForm_Activate()
Dim oOutlook As Object 'Outlook.Application
On Error Resume Next
Set oOutlook = GetObject(, "Outlook.Application")
If oOutlook Is Nothing Then
Set oOutlook = CreateObject("Outlook.Application")
End If
On Error GoTo 0
If oOutlook Is Nothing Then
MsgBox "Erro: não foi possível encontrar o Outlook.", vbCritical
Unload Me
Else
Set moMail = oOutlook.CreateItem(0)
End If
End Sub
Private Sub CommandButton1_Click()
Dim sFile As String
sFile = Application.GetOpenFilename("Todos os Arquivos (*.*),*.*")
If sFile <> CStr(False) Then
moMail.Attachments.Add sFile
MsgBox "Arquivo adicionado como anexo no e-mail.", vbInformation
End If
End Sub
Private Sub CommandButton2_Click()
moMail.Display 'ou .Send
End Sub
Private Sub UserForm_Terminate()
On Error Resume Next
moMail.Delete
Set moMail = Nothing
End Sub
Felipe Costa Gualberto - http://www.ambienteoffice.com.br