Email reply with form as attachment
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
"trayl" wrote:
Did you every get any response to this i'd also like to know how to do this
if you ever found out! thanks
"CAQ" wrote:
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?
|