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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send a custom contact form with a MailItem

Status
Not open for further replies.

cath11

Programmer
Jun 18, 2001
3
CA
Hi!
I customized a Contact form,I add a lot of fields on it like "To", "Subject" fields
and a button. On the click event of this button I want to send this Item(the contact form
that I modified). But I don't know how to add this Item to the MailItem. Also I don't how
to add the control "To" (textbox) to the recipients of this MailItem.
Here is my code maybe you could help me!
tanks

sub cmbSend_Click()
Set objOA = CreateObject("Outlook.Application")
Set objObject = objOA.CreateItem(olContactItem)
Set objThisPage = Item.GetInspector.ModifiedFormPages("CustomerForm")
Set colControls = objThisPage.Controls
Set objMail = objOA.CreateItem(olMailItem)
objMail.Attachments.Add Item
'objMail.Recipients = colControls("txtTo")
'objMail.Recipients.Add "michelc@biotonix.com"
objMail.To = colControls("txtTo")
objMail.Subject = colControls("txtSubject")
objMail.Send
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top