Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / General MS Word Questions / August 2004

Tip: Looking for answers? Try searching our database.

Submit Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andre - 18 Aug 2004 16:21 GMT
Is there a way to attach a submit button to a form created
in Word so that the user can click on it after fillin out
the form and it automatically emails itself to the server
or email address?
DA - 19 Aug 2004 07:34 GMT
Hi Andre

Yes, you can do this, although you'll have to use some
VBA. In your document, open the "Control Toolbox"
toolbar. Insert a button onto your form or document.

Double-click on the button whilst in the Design Mode. You
should see the VBA editor appear and show you a routine
called "Private Sub CommandButton1_Click()" or similar.

Paste the following code into the sub (change the
filename, subject and email address to suit) :

'------------------------------
ActiveDocument.SaveAs FileName:="c:\mydoc.doc"
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
   .Subject = "Your form is attached"
   .AddRecipient "youremail@email.com"
End With
ActiveDocument.Route
'------------------------------

This is probably the easiest way, but there are some
drawbacks. The email message will contain the following
text as the body:

"The attached document has a routing slip. When you are
done reviewing this document, choose Next Routing
Recipient from the Microsoft Office Word Send To menu on
the File menu to return the document to its sender."

If you're familiar with VBA, and you have Outlook
installed as your email program, you can send the doc as
an attachment to a standard outlook based email. Its a
little more complex, but using this method you can at
least specify the text body. If you want to learn more
about that sort of thing, have a look at
(http://word.mvps.org/FAQs/InterDev/SendMail.htm).

Good luck,
Dennis

>-----Original Message-----
>Is there a way to attach a submit button to a form created
>in Word so that the user can click on it after fillin out
>the form and it automatically emails itself to the server
>or email address?
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.