Take Value from List Box Column and place in the body of outlook email

dntel123

Registered User.
Local time
Today, 18:42
Joined
Feb 23, 2007
Messages
35
Hiya,

i have this code currently that places information from my form into a new email message using an outlook express object:

Code:
For Each varItem In lst.ItemsSelected
      'Check for email address
      strEMailRecipient = Nz(lst.Column(1, varItem))
      Debug.Print "EMail address: " & strEMailRecipient
      If strEMailRecipient = "" Then
         GoTo NextContact
      End If
   
   'Create new mail message and send to contact
   Set appOutlook = GetObject(, "Outlook.Application")
   Set msg = appOutlook.CreateItem(olMailItem)
   With msg
      .To = strEMailRecipient
      .Subject = strSubject
      .Body = strBody
      .Display
   End With
Now my list box has 3 columns name email and grade. There is already code that grabs the email from the listbox which is :

Code:
'Check for email address
      strEMailRecipient = Nz(lst.Column(1, varItem))
      Debug.Print "EMail address: " & strEMailRecipient
      If strEMailRecipient = "" Then
         GoTo NextContact
so im thinking how do i do this for the grade which is the 3rd column and place it at the end of the body saying your grade is [variable containing grade]

something like :

Code:
strGrade = Nz(lst.Column(3, varItem))
If strGrade = "" Then
GoTo NextContact
and then putting that into here somewhere:

Code:
.Body = strBody, strGrade

Not sure how it will fit though
If anyone could help me slot this in id be greatful :)
 
Something like...
Code:
.Body = strBody & strGrade
 
.body = MyListBox.Column(1,3)

You mave have to play with the numbers a bit to get it to point to the right spot.
Evan
 

Users who are viewing this thread

Back
Top Bottom