View Single Post
  #4  
Old January 30th 06, 05:12 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default different problem

Does it work Ok if you set the MailItem.HTMLBody property instead?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ram" wrote in message
...


Here is ther code, which i am written in "itemsend" event .





CComPtrOutlook::_Applicationm_applicant(m_spApp) ;

CComPtrOutlook::_Inspectorm_inspect;



HRESULT hr;

IDispatch *Pdisp;

IHTMLDocument2Ptr htmdocument=NULL;

IHTMLElement *htmelement;

BSTR m_bstr;

char ks[20000];

int net_lenght;

hr= m_applicant-ActiveInspector(&m_inspect);

if(FAILED(hr))

MessageBox(NULL,_T("This is not active inspector object"),_T("Current
Inspector"),MB_OK);

/*

else

MessageBox(NULL,_T("This is active inspector object"),_T("Current
Inspector"),MB_OK);

*/

hr=m_inspect-get_HTMLEditor(&Pdisp);


if(FAILED(hr))

MessageBox(NULL,_T("HTML Editor object is not
creating"),_T("Simleys"),MB_OK);

hr=Pdisp-QueryInterface(IID_IHTMLDocument2,(void**)&htmdoc ument);


if(FAILED(hr)||(htmdocument==NULL))

{

MessageBox(NULL,_T("IHTMLDocument Object is not
creating"),_T("Smileys"),MB_OK);

}

/*

else

MessageBox(NULL,_T("IHTMLDocument Object is not
creating"),_T("Smileys"),MB_OK);

*/



hr=htmdocument-get_body(&htmelement);

if(FAILED(hr))

{

MessageBox(NULL,_T("The htmelement is not intiated"),_T("Smileys"),MB_OK);

}


htmelement-get_innerHTML(&m_bstr);

net_lenght=WideCharToMultiByte(CP_ACP,0,m_bstr,-1,NULL,0,NULL,NULL);

WideCharToMultiByte(CP_ACP,0,m_bstr,-1,ks,net_lenght+1,NULL,NULL);

strcat(ks,"Here is text wiill be added");

net_lenght=sizeof(ks);

MultiByteToWideChar(CP_ACP,NULL,ks,-1,m_bstr,net_lenght+1);

htmdocument-put_designMode(CComBSTR("On"));

hr=htmelement-put_innerHTML(m_bstr);

if(hr==S_OK)


MessageBox(NULL,_T("Here text Added"),_T("Smileys"),MB_OK);

else


MessageBox(NULL,_T("text is not added"),_T("Smileys"),MB_OK);



htmdocument-put_designMode(CComBSTR("Off"));


Plz suggest me any solution



--
Regards,

RamakoteswaraRao Koti

"Dmitry Streblechenko" wrote in message
...
Please show the relevant snippets of your code.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ram" wrote in message
...
hi,

i have captured itemsend event. When ever the user click the
send
button, i used to add some data at the end of mail. It has been adding.

It
showing in the view,but when the mail is sent.it is not with mail.

how can i solve this

--
Regards,

RamakoteswaraRao Koti








Ads