Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2011, 01:32 PM
maddoktor maddoktor is offline Adding an Email Button to a Word Document Windows 7 32bit Adding an Email Button to a Word Document Office 2010 32bit
Novice
Adding an Email Button to a Word Document
 
Join Date: Dec 2011
Posts: 1
maddoktor is on a distinguished road
Default Adding an Email Button to a Word Document

Ok,



I have searched and tried many methods and they have all failed. I have created a word document that has a text field in it for my user to input an answer to a question I provide. I then want to add an email submit button to the word document so that when the user is finished then just click the button and the word document and the users response will be sent to an email address.

I have read many times and tried to add the sub program to the virtual basic content below.....

Private Sub CommandButton1_Click()
Dim olApp As Object
Dim olMsg As Object

Set olApp = CreateObject("Outlook.Application")
Set olMsg = olApp.CreateItem(0)
With olMsg
.To = "email add"
.Subject = "subject"
.Body = "body"
.Attachments.Add Me.Path + "\" + Me.Name
.Send
End With

Set olMsg = Nothing
Set olApp = Nothing

End Sub


I recieve the run-time error '-2147467259 (80004005)'

When I debug the program it has a problem with the line of code

.Send

I am using Word 2011

Any one have a suggest that someone like myslef that doesn't understand half of the code I am using right now.....laymans terms please!!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding an Email Button to a Word Document Adding a new email address to favorites? salin Outlook 3 11-16-2011 06:09 PM
Adding an Email Button to a Word Document I push the Tab button one time, but Word does it twice!!! why? Jamal NUMAN Word 2 06-26-2011 01:38 AM
Drag Button which refers to the active Word document to Explorer DRob Word 0 10-03-2010 06:40 AM
MS Word form - email button floydwood Word VBA 0 05-10-2009 04:11 PM
Adding bullets in a protected Word document Cindylu3 Word 0 10-03-2008 03:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft