Solved

send a custom Contact with a MailItem as an attachment

Posted on 2001-06-20
1
259 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
ID: 6244837
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Read this checklist to learn more about the 15 things you should never include in an email signature.
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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

808 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