Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending email using custom outlook form

Status
Not open for further replies.

kesm

Technical User
Jul 8, 2002
19
0
0
GB
Hi All,

I have up and running code to send email from a vb form.
Although, outlook security continualy asks for confirmation to allow programs access (this will be the next area I tackle if I can get this one to work), the emails are being sent ok.
I want a way to send emails using a particular custom form.

The code I have working to send mail items is as follows:

Dim MyOlApp As Outlook.Application
Dim MyItem As MailItem
Dim MyProp

Set MyOlApp = CreateObject("Outlook.Application")
Set MyItem = MyOlApp.CreateItem(olMailItem) 'MyOlApp.CreateItem(olMailItem)

Set MyProp = MyItem.UserProperties.Add("MyPropName", olText)

MyProp = "TEXT ITEM"
MyItem.Save

Set myAttachments = MyItem.Attachments
myAttachments.Add "C:\ESpool\Images\test.tif", _
olByValue, 1, "Test Attachment"

MyItem.To = "EMAILADDRESS"
MyItem.Send



I have tried to include custom (user) properties, but these aren't displayed withn the receivers email.

Can anybody help me to use VB code to send using a custom form.

TIA
kesm
 
Here's an example for displaying a custom form (assuming the form has been saved as an .oft)

Set myItem = Application.CreateItemFromTemplate("path to oft")
myItem.Display

Have fun.

Everybody body is somebodys Nutter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top