CDO 
Author Message
 CDO

The following code doesn't work:

Public Sub SendIt()
    Dim myCDO As New Outlook.MailItem

    myCDO.Attachments.Add "C:\TPTrades20000713.txt"

    myCDO.Send
End Sub

I receive error 429: ActiveX can't create object

Anyone know what to do about this?



Sun, 05 Jan 2003 03:00:00 GMT  
 CDO
You can't create an Outlook MailItem by using the New directive.  Instead
you create the object by working through the Outlook hierarchy.  For
example, the following would be correct if using the Outlook Object model.

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Attachments.Add "C:\TPTrades20000713.txt"

myItem.Send

And since you specified CDO in your subject...

' objSession is a valid MAPI.Session object
Set objNewMsg = objSession.Outbox.Messages.Add
' verify objNewMsg created successfully ... then supply properties
Set objSenderAE = objOriginalMsg.Sender ' sender as AddressEntry
With objNewMsg
   .Text = "How about a slightly used bicycle?" ' new text
   .Subject = objOriginalMsg.Subject ' copy original properties
   .ConversationTopic = objOriginalMsg.ConversationTopic
   ' append time stamp; compatible with Microsoft Exchange client
   Set objOneRecip = .Recipients.Add( _
              Name:=objSenderAE.Name, _
              Address:=objSenderAE.Type & ":" & objSenderAE.Address, _
              Type:=CdoTo)
   .Recipients.Resolve
   .Update
   .Send showDialog:=False
End With


Quote:
> The following code doesn't work:

> Public Sub SendIt()
>     Dim myCDO As New Outlook.MailItem

>     myCDO.Attachments.Add "C:\TPTrades20000713.txt"

>     myCDO.Send
> End Sub

> I receive error 429: ActiveX can't create object

> Anyone know what to do about this?



Sun, 12 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Seeking CDO object reference with correlated CDO PropTags / constants

2. Seeking CDO object reference with correlated CDO PropTags / constants

3. port outlook app to win2k, cdo 1.2 or cdo for windows 2000?

4. CDO and Opening an existing email...

5. help - Access97 + cdo

6. Help with CDO/Outlook mapi problem

7. CDO problem

8. Library - Where to get Microsoft CDO 1.21

9. CDO messaging in a MDB

10. ACCESS and CDO

11. CDO vs Outlook libraries

12. CDO and Access gets 80004005 error

 

 
Powered by phpBB® Forum Software