send a custom Contact with a MailItem as an attachment
Posted on 2001-06-20
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!
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.Recipients = colControls("txtTo")
objMail.To = colControls("txtTo")
objMail.Subject = colControls("txtSubject")