Help with email within a form

J

Justin Knupp

Hi all.

I have a form I've created and when completed I want to hit a button and
have it mail a completed notice to the person who requested/"owns" the form.

Here's my script:

Sub CommandButton1_Click()
Set NewMail = Item.Application.CreateItem(olMailItem)
NewMail.Subject = "Request Complete"
NewMail.Body = "Your request has been completed. Thank you."
NewMail.To = "(e-mail address removed)"
NewMail.Send
Set NewMail = Nothing
End Sub


Is there a way to pull the "owner" value from the form and insert it as
the value for the "NewMail.To" field?

Thanks for any help.
 
S

Sue Mosher [MVP-Outlook]

Maybe -- but you'll need to explain in more detail where the information on
who requested/"owns" the form might come from.

FYI, Application is an intrinsic object of its own in Outlook form code:

Set NewMail = Application.CreateItem(olMailItem)

and you need to either declare olMailItem as a constant or use its literal
value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top