Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. An Outlook plug-in issue

An Outlook plug-in issue

Scheduled Pinned Locked Moved ATL / WTL / STL
helpc++htmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dorutzu
    wrote on last edited by
    #1

    Hi, I'm witting an Outlook plugin in VC++, using ATL. When a button in outlook is pressed, my plug-in will create a new mail, or reply to the selected one, or forward it. Now, the problem is that after generating this new window(for new mail, reply or fwd), when I close Outlook, another instance of Outlook remains somewhere running (I see it in Task Manager, and I have to close it form there). Any ideea what do wrong? Here is part of my code from the reply command: for(int i=1; i<=lItemCount; i++) { CComPtr spDisp; CComVariant vt(i); //get selected item number i hr = spSelection->Item(vt, &spDisp); if(FAILED(hr)) return; CComQIPtr< Outlook::_MailItem > spMailItem(spDisp); CComPtr spMailItem2; if(FAILED(hr)) return; if(spMailItem!=NULL) { spMailItem->Reply(&spMailItem2); BSTR subj; spMailItem->get_Subject(&subj); CString str = "Re:"; str += W2T(subj); spMailItem2->put_Subject(T2W(str)); BSTR htmlBody; spMailItem->get_HTMLBody(&htmlBody); str = ReadHTMLIntoString((CString)W2T(bstrMSname)); //insert the Reply .html str += "

    Original text:

    "; //something between our text and the original text str += W2T(htmlBody); htmlBody = T2W(str); spMailItem2->put_HTMLBody(htmlBody); spMailItem2->Display(); } spMailItem2.Detach(); spMailItem.Detach(); spDisp.Detach(); } I think something should be done with spMailItem2, but I just don't know what. I would really appreciate any help. Thanks, Doru K

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups