Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word97 VBA Script for SendMailAttach

Status
Not open for further replies.

dmorris

Technical User
Jun 8, 2004
3
US
I have created a form with a command button at the bottom of the form to submit it via email. I am trying to figure out how to automatically populate the "To" field in outlook with an email address so the person filling out the form doesn't have to. Can anyone point me in the right direction?
 
if you are using the outlook object model in VBA (go to tools, references and select outlook 9...), you can do the following:

Dim olApp As New Outlook.Application
Dim olItem As MailItem
Set olItem = olApp.CreateItem(olMailItem)
With olItem
.To = "swilliams@paragon.bm"
.Subject = "Test from Word VBA"

.Send
End With

Simon [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top