send a custom Contact with a MailItem as an attachment
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")
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.