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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create E-Mail Message with an Embedded List

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
I am using the Outlook Object to create a new e-mail message from Excel. In the body of the message I would like to include a list of offices which are stored in an array. The list is not of a defined size- it may contain one office or 100 offices, depending upon what is in the array.

Here is a portion of my code. Is this possible?

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem

Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)...

objMail.Subject = "Missing Offices"
For I = 1 To NoMissing
objMail.Body = theControlData(I).Finance & "- " & _
theControlData(I).OfficeName + Chr(10)
Next I
objMail.Recipients.Add "Joe Blow"
objMail.Send...

The message is created successfully but I don't get a list of offices, I only get the last office in the array.

Thanks.


 
I know nothing of this object but logically the following would seem to be the solution
Code:
For I = 1 To NoMissing
objMail.Body = objMail.body & theControlData(I).Finance & "- " & theControlData(I).OfficeName + Chr(10)
Next I


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top