Solved

Confirmation on Submit button for MS Word Form

Posted on 2014-03-26
1
1,984 Views
Last Modified: 2014-04-10
I'm using the following code on a submit button in a MS Word form:
---------------------------------------------------------------------------------------
Private Sub CommandButton1_Click()
Dim OL              As Object
Dim EmailItem       As Object
Dim Doc             As Document
 
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
 
With EmailItem
    .Subject = "History Month Quiz"
    .Body = "Insert message here" & vbCrLf & _
    "Body Line 2" & vbCrLf & _
    "Body Line 3"
    .To = "Name@someplace.com"
    .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
    .Attachments.Add Doc.FullName
    .Send
End With
 
Application.ScreenUpdating = True
 
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
   
End Sub
------------------------------------------------------------------------
Is there code I can add that would pop up an confirmation as in "Your form has been submitted. Thanks!" and/or an email a confirmation to the submitter?

Using MS Word 2010 and Outlook 2010
0
Comment
Question by:SFrongillo
1 Comment
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 39956730
Initial thought the easiest would seem to be:

msgbox "Your form has been submitted. Thanks!"

For example immediately after the line:

Application.ScreenUpdating = True

Chris
2

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question