CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Location
    Kenosha, Wi
    Posts
    37

    Adding an attachment to Outgoing Outlook Email

    Ok everyone,

    I am no officially desparate... All I want is to be able to post the
    following attachment to every message outgoing that is sent through my
    Outlook Client. I have commented the code to better aide you in what I
    am doing:

    ########### CODE ##############

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
    Boolean)

    'Dim objAttach As Outlook.Attachment

    Set objAttach = objAttachColl.Add ' add an attachment
    With objAttach
    .Type = CdoFileLink
    .Position = 0 ' place at beginning of message
    .Source = "\\server\bitmaps\honey.bmp" ' UNC name
    End With
    ' must update the message to save the new info
    objOneMsg.Update ' update the message

    End Sub

    ########## CODE #####################

    I get the folowing error message everytime:

    Run-Time error '424'
    Object Required

    Ok, what object is it looking for and how do I tell outlook what the
    existing object is? Please help me in determining what it is I am
    doing wrong. Thank you in advance.

    Timothy H. Schilbach
    Messaging Administrator
    Snapon Tools
    [email protected]
    262-656-6184



    Timothy H. Schilbach
    Alpha Omega Design Inc.
    [email protected]

  2. #2
    Join Date
    Sep 2001
    Location
    Montreal Canada
    Posts
    1,080

    Re: Adding an attachment to Outgoing Outlook Email

    Did you add the mapi component ?

    Nicolas Bohemier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured