Solved

send a custom Contact with a MailItem as an attachment

Posted on 2001-06-20
1
255 Views
Last Modified: 2010-04-08
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
0
Comment
Question by:cath11
1 Comment
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 50 total points
Comment Utility
The ContactItem object exposes a SaveAs method that will allow you to save the item to the file system as an "olMsg".  If you save the contact to a predefined place on the file system, you can use the Attachtement.Add routine.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

My experience with Windows 10 over a one year period and suggestions for smooth operation
Set OWA language and time zone in Exchange for individuals, all users or per database.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now