Solved

send a custom Contact with a MailItem as an attachment

Posted on 2001-06-20
1
263 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
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…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

617 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