Command Button to send word email attachment

G

Guest

I have created a command button "submit" on a word document and have tried to
create a macro to email it, however i have done something wrong as the
attachment is not being created. Could someone please help me ASAP!

Sub CommandButton1_Click()

Dim Email As Object
Dim Attachment As String

Set Email = CreateObject("Outlook.Application") 'Assign Outlook application
to variable


With Email.CreateItem(olMailItem)
.to = "<>" 'email address
.Subject = "Incident Report" 'Something for the subject Field
.body = ActiveDocument
.Display = Attachment

Options.SendMailAttach = True


End With
 
R

Rock

HELP said:
I have created a command button "submit" on a word document and have tried
to
create a macro to email it, however i have done something wrong as the
attachment is not being created. Could someone please help me ASAP!

Sub CommandButton1_Click()

Dim Email As Object
Dim Attachment As String

Set Email = CreateObject("Outlook.Application") 'Assign Outlook
application
to variable


With Email.CreateItem(olMailItem)
.to = "<>" 'email address
.Subject = "Incident Report" 'Something for the subject Field
.body = ActiveDocument
.Display = Attachment

Options.SendMailAttach = True


End With


You might want to post to a Word newsgroup.
 

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