Solved

Confirmation on Submit button for MS Word Form

Posted on 2014-03-26
1
1,868 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now