Email reply with form as attachment

G

Guest

I have created a survey form in MS Word 2003 for my company. I will be
emailing the document to various people however, I have been unable to get
the completed form to reply back.

I need help writing the macro code to accomplish the following:

User clicks on checkbox to submit survey responses
The form auto saves
the form then attaches to email (outlook) and returns to me
Subject = Survey Response
Message Box stating "your responses have been sent. Thank you."

All without any intervention on the part of the user (except clicking the
checkbox).

Any ideas?
 
G

Guest

Did you every get any response to this i'd also like to know how to do this
if you ever found out! thanks
 
G

Guest

First -- the macro security setting must be at medium or lower. If med then
the user will be prompted to enable the macros.

the code is as follows:

Sub SaveUpdateSave()

Dim aStory As Range
Dim aField As Field

For Each aStory In ActiveDocument.StoryRanges
ActiveDocument.Save
For Each aField In aStory.Fields
'MsgBox aField.Parent

If aField.Type = Word.wdFieldSubject Then

ActiveDocument.Save
aField.Update

ElseIf aField.Type = Word.wdFieldTitle Then

ActiveDocument.Save
aField.Update

ElseIf aField.Type = Word.wdFieldSaveDate Then

ActiveDocument.Save
aField.Update

ElseIf aField.Type = Word.wdFieldPage Then

ActiveDocument.Save
aField.Update

ElseIf aField.Type = Word.wdFieldNumPages Then

ActiveDocument.Save
aField.Update

End If
Next aField
Next aStory
ActiveDocument.Save
End Sub

Sub Email()

ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Survey Response"
.AddRecipient "your email address"
.Delivery = wdAllAtOnce
MsgBox "Your responses have been submitted. Thanks for your
participation."
End With
ActiveDocument.Route
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