Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: 12 Jul 2005 16:38:30 -0700,    group: microsoft.public.platformsdk.messaging        back       


CDO 1.21 programming bug   
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.
date: 12 Jul 2005 16:38:30 -0700   author:   James Toomey

Re: CDO 1.21 programming bug   
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
date: Tue, 16 Aug 2005 16:44:31 +0100   author:   Waldy

RE: CDO 1.21 programming bug   
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.
> 
>
date: Thu, 27 Oct 2005 05:54:01 -0700   author:   Matthew Gibson

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us