Problems while integrating with outlook 2007

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::eek:lEditorWORD) while office 2003
used to open the mail content in html editor (enum value in msoutl.tlh
is Outlook::eek: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
 
B

BartH_NL

Hello Ranga,

I have not worked with this yet, but I understand they want to make
everything XML compliant. So just a hunch is: can't you approach your
data through the XML output of the file?

Regards,
BartH
 
R

ranga

H BartH,

Thanks for the quick reply.

If i have understood your reply correctly, my problem is picking up
the selected data from the opened mail item. Once i get the selected
data, then i can save it any format. So i should be able to get the
selected data from the word editor. I am not able to find the right
api's and interfaces in the newly generated .tlh file.

Thanks
 
K

Ken Slovak - [MVP - Outlook]

Body text is not stored as XML at all. It's stored as a PT_STRING8 property
(or PT_Unicode) on the item. Same for HTMLBody.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top