Following on from thread181-75403
I would like to know if it is possible to add multiple attachements by looping through a series of records:
Amongst others, I have a felid called NDCLink in a one of my DB's. I was thinking of being able to loop through those records where [Check] is equal to true and include the info from the [NDCLink] feild to ceate a list of multipe attachements that have to the included in my email (Not sure if this can be done?)
Here is below is an extract of what I'm trying:
If Forms!MainScreen!Check!= True Then
Set Re = CurrentDb.OpenRecordset("SELECT * FROM Header WHERE Check = True")
Do While Not Re.EOF
AttName= Forms!MainScreen!NDCLink & Re!NDCLink & "; "
CountOf = CountOf + 1
Re.MoveNext
Loop
End If
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = Whomever may be interested
.Subject = "<MySubject>"
.HTMLBody = "<BodyText>"
.Attachments.Add AttName
.Display
End With
End if
I've been reading though the threads that are issung multiple attachments and cannot find too much on how I can get this one to work.
Any ideas out there?
JMC014
I would like to know if it is possible to add multiple attachements by looping through a series of records:
Amongst others, I have a felid called NDCLink in a one of my DB's. I was thinking of being able to loop through those records where [Check] is equal to true and include the info from the [NDCLink] feild to ceate a list of multipe attachements that have to the included in my email (Not sure if this can be done?)
Here is below is an extract of what I'm trying:
If Forms!MainScreen!Check!= True Then
Set Re = CurrentDb.OpenRecordset("SELECT * FROM Header WHERE Check = True")
Do While Not Re.EOF
AttName= Forms!MainScreen!NDCLink & Re!NDCLink & "; "
CountOf = CountOf + 1
Re.MoveNext
Loop
End If
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = Whomever may be interested
.Subject = "<MySubject>"
.HTMLBody = "<BodyText>"
.Attachments.Add AttName
.Display
End With
End if
I've been reading though the threads that are issung multiple attachments and cannot find too much on how I can get this one to work.
Any ideas out there?
JMC014