
Doesn't recognize name or names
It sounds more like your code is using names instead of actual email
addresses and one or more of the names cannot be resolved from an
address book to a valid email address.
Use the .Recipients.ResolveAll method before you Send and if it fails
then iterate the Recipients collection and for each Recipient object
use the Resolve method. That way you will know which one is failing
and you can correct that or remove that Recipient from the Recipients
collection.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
Quote:
> I have an Access program which calls/opens Outlook to
> >send an email. Outlook pulls the message and email
> >addresses from the Access program. At the ".send" line
> >of code, I am getting a message that reads "Outlook does
> >not recognize a name or names." In reviewing the code
> >with others, it would seem that this has to do with some
> >Outlook settings. Anyone have any thoughts/ideas??
> >Thanks! Tammy
> >(I'll include the code, just in case...
> >Private Sub cmdOKEmail_Click()
> >On Error GoTo Err_cmdOKEmail_Click
> >'
> >Dim db As Database
> >Dim objOutlook As Outlook.Application
> >Dim objMessage As MailItem
> >Dim strNote As String
> >Dim strFromAuthor As String
> >Dim varItem As Variant
> >Dim strCCs As String
> >Dim strAttach As String
> >Dim strPath As String
> >Dim strToName As String
> >Dim recSupers As DAO.Recordset
> >strPath = "C:/My Documents/Saved SOP's/"
> >strNote = "Dear" & strToName & _
> >vbCrLf & vbCrLf & _
> >Me![txtMessage] & _
> >vbCrLf & vbCrLf & _
> >Me![Author]
> >Set db = CurrentDb()
> >Set recSupers = db.OpenRecordset("Supers", dbOpenDynaset)
> >Set objOutlook = Outlook.Application
> >Set objMessage = objOutlook.CreateItem(olMailItem)
> >strCCs = ""
> >If Me![lstCarbon].ItemsSelected.Count = 0 Then
> > GoTo msg1:
> >Else
> > For Each varItem In Me![lstCarbon].ItemsSelected
> > strCCs = strCCs & Me![lstCarbon].Column(2,
> >varItem) & ","
> > Next varItem
> > strCCs = Left(strCCs, Len(strCCs) - 1)
> >End If
> >msg1:
> >With objMessage
> > .To = Me![cmbSupers]
> > .CC = strCCs
> > .Subject = "New SOP" & Me![SOP Name]
> > .Body = strNote
> >** .Send ********Error on this line
> >End With
> >recSupers.Close
> >Set recSupers = Nothing
> >Set objOutlook = Nothing
> >Set objMessage = Nothing
> >Me![cmdNew].Visible = True
> >Exit_cmdOKEmail_Click:
> > Exit Sub
> >Err_cmdOKEmail_Click:
> > MsgBox Err.Description
> > Resume Exit_cmdOKEmail_Click
> >End Sub
> >.