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.
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.