Send Attachment

B

Buzzmcduffie

I need a command button on my word template which will
automatically attach the template to an email, address it,
fill in the subject line and message.
I've gotten this far but need help with the email address,
subject line and message

Private Sub CommandButton1_Click()
Options.SendMailAttach = True
ActiveDocument.SendMail
End Sub

Thanks!!

..
 
S

Steve Lang

Yo Buzz, how about this:


Private Sub CommandButton1_Click()
Dim myOutlook As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myItem As Object

Set myOutlook = CreateObject("Outlook.Application")
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set myItem = myOutlook.CreateItem(olMailItem)
With myItem
.To = <<Insert string of names to send to>>
.Subject = <<INsert string of subject>>
.Body = <<Insert string of body text>>
.Attachments.Add <<Insert string of path to the document (or
template)>>
.Send
End With
Set myItem = Nothing
Set myNameSpace = Nothing
Set myOutlook = Nothing
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top