R
ranga
Hi All,
I work for a adobe product called Contribute, we have Microsoft Office
plugin integrated to our product. To be specific, When we have opened
an existing mail item in outlook, we can select some portion of the
mail data or full mail content and can open it in our contribute
application for futher contribute specific operations.
And we had integrated office 2003 also with our product, now i am
checking whether the same code works for office 2007 or it needs
changes.
I came across several issues and started debuging it.
First of all, in office 2007, the mail content gets opened in
wordeditor (enum value is Outlook:lEditorWORD) while office 2003
used to open the mail content in html editor (enum value in msoutl.tlh
is Outlook:lEditorHTML).
In our code while looking for the selection in the opened mail item, we
used to use API which are for html editor as shown below
//See if there is a selection in the document
IDispatch* pHtmlEditor = NULL;
m_Inspector->get_HTMLEditor(&pHtmlEditor);
if(pHtmlEditor)
{
CComQIPtr <IHTMLDocument2> html(pHtmlEditor);
ATLASSERT(html);
CComPtr <IHTMLSelectionObject > selection;
html->get_selection(&selection);
if(!selection)
{
ATLASSERT(selection);
return;
}
IDispatch* pRange = NULL;
selection->createRange(&pRange);
if(pRange)
{
CComQIPtr<IHTMLTxtRange> textRange(pRange);
BSTR pText = NULL;
textRange->get_text(&pText);
BSTR pHtmlText = NULL;
textRange->get_htmlText(&pHtmlText);
But now with office 2007, since outlook always opens in wordeditor ,
our APIs for html editor doesnot work.
And the interfaces IHTMLDocument2 ,IHTMLSelectionObject ,IHTMLTxtRange
etc.. works only for html editor not for wordeditor.
Now i want to figureout how to implement the same thing for word
editor.
Has any come across this issues, or anyone has any pointers about how
to go ahead to get the selection worked for outlook2007.
Thanks in advance
--ranga
I work for a adobe product called Contribute, we have Microsoft Office
plugin integrated to our product. To be specific, When we have opened
an existing mail item in outlook, we can select some portion of the
mail data or full mail content and can open it in our contribute
application for futher contribute specific operations.
And we had integrated office 2003 also with our product, now i am
checking whether the same code works for office 2007 or it needs
changes.
I came across several issues and started debuging it.
First of all, in office 2007, the mail content gets opened in
wordeditor (enum value is Outlook:lEditorWORD) while office 2003
used to open the mail content in html editor (enum value in msoutl.tlh
is Outlook:lEditorHTML).
In our code while looking for the selection in the opened mail item, we
used to use API which are for html editor as shown below
//See if there is a selection in the document
IDispatch* pHtmlEditor = NULL;
m_Inspector->get_HTMLEditor(&pHtmlEditor);
if(pHtmlEditor)
{
CComQIPtr <IHTMLDocument2> html(pHtmlEditor);
ATLASSERT(html);
CComPtr <IHTMLSelectionObject > selection;
html->get_selection(&selection);
if(!selection)
{
ATLASSERT(selection);
return;
}
IDispatch* pRange = NULL;
selection->createRange(&pRange);
if(pRange)
{
CComQIPtr<IHTMLTxtRange> textRange(pRange);
BSTR pText = NULL;
textRange->get_text(&pText);
BSTR pHtmlText = NULL;
textRange->get_htmlText(&pHtmlText);
But now with office 2007, since outlook always opens in wordeditor ,
our APIs for html editor doesnot work.
And the interfaces IHTMLDocument2 ,IHTMLSelectionObject ,IHTMLTxtRange
etc.. works only for html editor not for wordeditor.
Now i want to figureout how to implement the same thing for word
editor.
Has any come across this issues, or anyone has any pointers about how
to go ahead to get the selection worked for outlook2007.
Thanks in advance
--ranga