Doesn't recognize name or names 
Author Message
 Doesn't recognize name or names

I have an Access program which calls/opens Outlook to
Quote:
>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
>.



Sun, 04 Dec 2005 19:44:46 GMT  
 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
> >.



Sun, 04 Dec 2005 21:14:01 GMT  
 Doesn't recognize name or names
Major "duh" here!!  Thanks for the direction!
Quote:
>-----Original Message-----
>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



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

>.



Mon, 05 Dec 2005 23:55:28 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Changing control name of button doesn't change event name to be the same

2. "Outlook doesn recognize name"

3. edit names on menu doesn't work

4. Clipboard.SetText doesn't set the correct font name

5. FileCopy doesn't copy to network name?

6. Q: Problems with FileListBox - doesn't show long file names

7. NetGroupGetUsers doesn't give full name????

8. Can't Get full File name for Long file names

9. Getting the user's logon name and computer name

10. VBA Doesn't recognize DAO.RecordSet

11. HELP : Access 97 doesn't recognize my MDB file

12. VB doesn't recognize ODBC stuff.

 

 
Powered by phpBB® Forum Software