Command Button to send word email attachment

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top