Outlook Object Model

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Deepak Bhatia

    Outlook Object Model

    Hello Friends

    I wrote a simple VB application using Outlook Object Model. This
    application is used t send mail via MS Outlook. I wrote following code
    on Send button:

    Set mailitem = obj.CreateItem( olMailItem)
    Set objname = obj.GetNamespac e("MAPI")
    mailitem.To = "dbhatia@pscind ia.com"
    mailitem.Body = RichTextBox1.Te xtRTF
    mailitem.Subjec t = "TestMail using OL"
    mailitem.Send

    Control used:
    1) RichEdit Box (for formatted message)
    2) Send Button
    3) Outlook Object Model.

    Note: MS Outlook is set to default mail client. Mail format is set to
    Rich Text.

    Problem:
    1) When I click send button. Mail doesn't send immediately. I have to
    click Send/Receive button of MS Outlook to send the mail.

    2)When I receive a mail,message is appeared as plain text instead of
    formatted message. When I looked at Sent folder of MS Outlook
    formatted message is displayed.

    [Note: If I send formatted mail via MS Outlook all works well means I
    received formatted mail.]

    Can you please help me in solving above problem?

    If problem is not clear feel free to ask any question.

    Thanks & Regards
    Deepak.
  • Shashank Date

    #2
    Re: Outlook Object Model


    "Deepak Bhatia" <deepaksbhatia@ indiatimes.com> wrote in message
    news:e31ce4d4.0 306260418.57d72 [email protected] gle.com...[color=blue]
    > Hello Friends
    >
    > I wrote a simple VB application using Outlook Object Model. This
    > application is used t send mail via MS Outlook. I wrote following code
    > on Send button:
    >
    > Set mailitem = obj.CreateItem( olMailItem)
    > Set objname = obj.GetNamespac e("MAPI")
    > mailitem.To = "dbhatia@pscind ia.com"[/color]
    ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
    [snip]

    Try this instead:

    mailitem.Recipi ents.Add("dbhat [email protected] ")


    Take a look at Microsoft Knowledge Base Article - 209948 for more details.
    Hope that helps,
    -- Shashank


    Comment

    Working...