PC Review


Reply
Thread Tools Rate Thread

CDO 1.21 programming bug

 
 
James Toomey
Guest
Posts: n/a
 
      13th Jul 2005
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 = "(E-Mail Removed)"
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.

 
Reply With Quote
 
 
 
 
Waldy
Guest
Posts: n/a
 
      16th Aug 2005
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


 
Reply With Quote
 
=?Utf-8?B?TWF0dGhldyBHaWJzb24=?=
Guest
Posts: n/a
 
      27th Oct 2005
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 = "(E-Mail Removed)"
> 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.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choice of programming tool for Outlook programming tanutatu@hotmail.com Microsoft Outlook VBA Programming 4 13th Jul 2006 10:48 AM
Which programming language for programming for fun? Chris Freeware 18 3rd Apr 2006 01:06 PM
Will OOP programming go off and be replaced by AOP programming marathikaka@yahoo.co.in Microsoft VB .NET 3 23rd Aug 2005 03:49 PM
rpilot programming language - based on the pilot programming language *ProteanThread* Freeware 0 1st Feb 2005 10:10 PM
IIS programming Oleg Ogurok Microsoft Dot NET Framework 2 30th May 2004 02:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 PM.