Hi,
I've got some code (with help from this forum!) that allows me to select certain categories of staff in my database and add all those email addresses into one message. I've tested this and it's working fine, using both Outlook 2003 (at work) and Outlook 2007 (at home)
Now I need to add this into a copy of the database that a colleague of mine will be using. The problem is that she works off-site most of the time and gets her work email through Outlook Web App.
Is there a way to amend this code so that it will work for her? The relevant part of the code is as follows:
As far as I know she does have Outlook on her PC, but she can't connect her work email address to it.
Grateful for any help,
I've got some code (with help from this forum!) that allows me to select certain categories of staff in my database and add all those email addresses into one message. I've tested this and it's working fine, using both Outlook 2003 (at work) and Outlook 2007 (at home)
Now I need to add this into a copy of the database that a colleague of mine will be using. The problem is that she works off-site most of the time and gets her work email through Outlook Web App.
Is there a way to amend this code so that it will work for her? The relevant part of the code is as follows:
Code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
rst.Open "EmailList", CurrentProject.Connection
'Get each e-mail address
Do While Not rst.EOF
strTo = rst.Fields("EmailAddress").Value & ";"
strToSQL = strToSQL & strTo
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
If Len(strToSQL) > 0 Then
strToSQL = Left(strToSQL, Len(strToSQL) - 1) 'Remove any remaining semi-colons
End If
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
'Display the message
With objOutlookMsg
objOutlookMsg.To = strToSQL
' objOutlookMsg.Subject = strSubject
' objOutlookMsg.Body = strMessage
objOutlookMsg.BodyFormat = olFormatHTML
objOutlookMsg.Importance = olImportanceNormal
objOutlookMsg.Display
End With
Set objOutlook = Nothing
As far as I know she does have Outlook on her PC, but she can't connect her work email address to it.
Grateful for any help,