Thread: [Solved] Email submit that...
View Single Post
 
Old 02-11-2013, 03:02 PM
antipelagian antipelagian is offline Windows XP Office 2010 32bit
Novice
 
Join Date: Feb 2013
Location: Ohio
Posts: 4
antipelagian is on a distinguished road
Default Email submit that...

What I'd like to do:
Find script/code for a command button that creates an email, attaches the active form but does NOT send the email. I'd like it to create the email, attach the file but pop up the email so the user can attach supporting documentation then manually send it.

Where I'm at:
I'm pretty new to making forms via Word...I'm used to making forms in LiveCycle Designer using javascript, so I'm kind of lost tweaking the code in Word. Here's what I have:

Code:
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 = "Contract Initiation Form has been submitted" 
    .Body = "Please review the attached Form" 
    .To = "example@this.com" 
     
    .Cc = "example@this.com" 
    .Attachments.Add Doc.FullName 
    .Send 
End With 
 
Application.ScreenUpdating = True 
 
Set Doc = Nothing 
Set OL = Nothing 
Set EmailItem = Nothing 
 
End Sub
I'm trying to understand what each part of this code does...but for the life of me, I can't figure how to prevent the automated email submission. Do I tweak .Send? I tried deleting it that didn't help.

Bonus Points:
Can you create pop up warning windows via Word form? I'd like a pop-up that presents itself after the submit button is clicked reminding the user to attach additional documents...this is just for bonus brownie points

Last edited by macropod; 02-11-2013 at 04:39 PM. Reason: Added code tags & formatting
Reply With Quote