Solved

send a custom Contact with a MailItem as an attachment

Posted on 2001-06-20
1
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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: …

756 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