PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
CDO 1.21 programming bug
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
CDO 1.21 programming bug
![]() |
CDO 1.21 programming bug |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Has anyone else encountered this? When I run this code,
Set objSession = New MAPI.Session objSession.Logon profileName:="Outlook" Set objMessage = objSession.Outbox.Messages.Add objMessage.Subject = "test" objMessage.Text = "test" Set objRecipient = objMessage.Recipients.Add objRecipient.Name = "RecipientEmail@Email.com" objRecipient.Type = 1 objRecipient.Resolve objMessage.Send it runs fine and sends the email. However, if I change the last line to objMessage.Send showDialog:=True it *intermittently* gives the error "Object Could Not be Found." The bizarre thing is, sometimes it works and sometimes doesn't. If the user gets the error, I've tried checking/unchecking different options such as, "Always check spelling before sending", and sometimes it'll start working. I'm completely stumped about what causes it to start working, though. It'd make my day if anyone else out there has experienced this and/or knows of a way to consistently cure it. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Are you doing this in VBA? The reason I ask is because you are using a
named parameter. If not, try: objMessage.Send False, True |
|
|
|
#3 |
|
Guest
Posts: n/a
|
If you are showing the dialog you cant set the recipient. Remove the
recipient code and try it. "James Toomey" wrote: > Has anyone else encountered this? When I run this code, > Set objSession = New MAPI.Session > objSession.Logon profileName:="Outlook" > Set objMessage = objSession.Outbox.Messages.Add > objMessage.Subject = "test" > objMessage.Text = "test" > Set objRecipient = objMessage.Recipients.Add > objRecipient.Name = "RecipientEmail@Email.com" > objRecipient.Type = 1 > objRecipient.Resolve > objMessage.Send > > it runs fine and sends the email. However, if I change the last line to > > objMessage.Send showDialog:=True > > it *intermittently* gives the error "Object Could Not be Found." > The bizarre thing is, sometimes it works and sometimes doesn't. If the > user gets the error, I've tried checking/unchecking different options > such as, "Always check spelling before sending", and sometimes it'll > start working. I'm completely stumped about what causes it to start > working, though. It'd make my day if anyone else out there has > experienced this and/or knows of a way to consistently cure it. > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

