Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: different problem

Geek News

different problem
"Ram" <koti[ at ]nannacomputers.com> 1/28/2006 9:28:55 PM
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


Re: different problem
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/29/2006 9:28:05 PM
Please show the relevant snippets of your code.

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

"Ram" <koti[ at ]nannacomputers.com> wrote in message
news:emSeUGFJGHA.3192[ at ]TK2MSFTNGP10.phx.gbl...
[Quoted Text]
> 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
>
>


Re: different problem
"Ram" <koti[ at ]nannacomputers.com> 1/30/2006 5:33:06 AM


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





CComPtr<Outlook::_Application>m_applicant(m_spApp);

CComPtr<Outlook::_Inspector>m_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**)&htmdocument);


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" <dmitry[ at ]dimastr.com> wrote in message
news:#BPe1qRJGHA.1288[ at ]TK2MSFTNGP09.phx.gbl...
[Quoted Text]
> Please show the relevant snippets of your code.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Ram" <koti[ at ]nannacomputers.com> wrote in message
> news:emSeUGFJGHA.3192[ at ]TK2MSFTNGP10.phx.gbl...
> > 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
> >
> >
>
>


Re: different problem
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/30/2006 5:12:20 PM
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" <koti[ at ]nannacomputers.com> wrote in message
news:eZ5Li5VJGHA.3936[ at ]TK2MSFTNGP10.phx.gbl...
[Quoted Text]
>
>
> Here is ther code, which i am written in "itemsend" event .
>
>
>
>
>
> CComPtr<Outlook::_Application>m_applicant(m_spApp);
>
> CComPtr<Outlook::_Inspector>m_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**)&htmdocument);
>
>
> 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" <dmitry[ at ]dimastr.com> wrote in message
> news:#BPe1qRJGHA.1288[ at ]TK2MSFTNGP09.phx.gbl...
>> Please show the relevant snippets of your code.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Ram" <koti[ at ]nannacomputers.com> wrote in message
>> news:emSeUGFJGHA.3192[ at ]TK2MSFTNGP10.phx.gbl...
>> > 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
>> >
>> >
>>
>>
>
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net