Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Can not add CommandBar if "Word 2003 to read Rich Text e-mail" isselected. (http://www.outlookbanter.com/add-ins-outlook/80220-can-not-add-commandbar-if.html)

[email protected] October 14th 08 11:01 AM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" isselected.
 
Hi,

I have to add CommandBar in inspector (Outlook 2003).
I am handling "NewInspector" event and getting handle of inspector.

I face problem when i receive an e-mail with Rich Text and open it.
As Word 2003 is selcted as default editor to read e-mails with rich
Rich Text, whatever CommandBar I add to the inspector is not visible.

inspector.IsWordMail() - returns me false.
inspector.WordEditor - returns me null. (Security Pop-up as well)
inspector.HTMLEditor - returns me null.
inspector.EditorType - returns me "olEditorRTF".

Is there any solution available for this ?

Thanks and Best Regards,
Nikhil Sharma


[email protected] October 14th 08 11:04 AM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" isselected.
 
Additional Note :

Hi,
I am not facing the same issue, if i open new (mail) inspector (and
ofcourse "Word 2003 to edit e-mail" is selected), here also i am
receiving same "NewInspector" event and in this case, whatever
CommandBar i add to inspector gets added to the word editor, and
after this step if i open existing mail then also i can see this
CommandBar which i created while New (mail) Inspector. But issue is,
if i do not open New (mail) inspector first, and i open existing mail
first, this CommandBar is not added to word Editor.
I debugged and found out, once you open new (mail) inspector it gives
you Word Editor handle, but in existing mail it gives you Outlook
default editor handle.
why this kind of discrepancy is there i dont have any idea.

Thanks and Best Regards,
Nikhil Sharma

Ken Slovak - [MVP - Outlook] October 14th 08 02:32 PM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" is selected.
 
Try waiting for the initial Inspector.Activate() event before you test for
IsWordMail() or try to get WordEditor or adding your UI. See if that helps.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


wrote in message
...
Additional Note :

Hi,
I am not facing the same issue, if i open new (mail) inspector (and
ofcourse "Word 2003 to edit e-mail" is selected), here also i am
receiving same "NewInspector" event and in this case, whatever
CommandBar i add to inspector gets added to the word editor, and
after this step if i open existing mail then also i can see this
CommandBar which i created while New (mail) Inspector. But issue is,
if i do not open New (mail) inspector first, and i open existing mail
first, this CommandBar is not added to word Editor.
I debugged and found out, once you open new (mail) inspector it gives
you Word Editor handle, but in existing mail it gives you Outlook
default editor handle.
why this kind of discrepancy is there i dont have any idea.

Thanks and Best Regards,
Nikhil Sharma



[email protected] October 15th 08 10:39 AM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" isselected.
 
Hi Ken Slovak,
Thanks for response,
Your suggestion helped me to had littile progress but not the
solution.

As per your suggestion i handled "NewInspector" Event and in that
handler i register "((InspectorEvents_10_Event)Inspector).Activat e"
Event.
So when execution comes to Activate Event handler, Properties values
are now as follows :

inspector.IsWordMail() - returns me false. - now it returns me true
inspector.WordEditor - returns me null. (Security Pop-up as well) -
still same :(
inspector.HTMLEditor - returns me null. (Security Pop-up as well) -
still same
inspector.EditorType - returns me "olEditorRTF". - now it returns me
"olEditorWord"

so still i am not able to add my CommandBar to inspector.

And when i try activate inspector by using code it thorws me exception
"Unable to display item." (COMException - ErrorCode : 0xfbc20009)

I need to show my toolbar once inspector is visible. and i didn't find
any Displayed/VisibleChange Event or Activated Event in Outlook object
model.
Surprisingly everything (same code) is working fine for new inspector.
(create new mail), as i mentioned in my additional note.

In your opinion, is any solution available for this issue?

Thanks and Best Regards,
Nikhil Sharma

Ken Slovak - [MVP - Outlook] October 15th 08 04:27 PM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" is selected.
 
Is this version of Word from the same package and SKU as the Outlook
version?

It's odd that you get IsWordMail() == true but get an error and security
popup when accessing WordEditor. Is this a VSTO addin or a shared managed
code addin?

Are you deriving all of your Outlook objects from the Application object
passed to you in your startup event handler (either Startup or
OnConnection)?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


wrote in message
...
Hi Ken Slovak,
Thanks for response,
Your suggestion helped me to had littile progress but not the
solution.

As per your suggestion i handled "NewInspector" Event and in that
handler i register "((InspectorEvents_10_Event)Inspector).Activat e"
Event.
So when execution comes to Activate Event handler, Properties values
are now as follows :

inspector.IsWordMail() - returns me false. - now it returns me true
inspector.WordEditor - returns me null. (Security Pop-up as well) -
still same :(
inspector.HTMLEditor - returns me null. (Security Pop-up as well) -
still same
inspector.EditorType - returns me "olEditorRTF". - now it returns me
"olEditorWord"

so still i am not able to add my CommandBar to inspector.

And when i try activate inspector by using code it thorws me exception
"Unable to display item." (COMException - ErrorCode : 0xfbc20009)

I need to show my toolbar once inspector is visible. and i didn't find
any Displayed/VisibleChange Event or Activated Event in Outlook object
model.
Surprisingly everything (same code) is working fine for new inspector.
(create new mail), as i mentioned in my additional note.

In your opinion, is any solution available for this issue?

Thanks and Best Regards,
Nikhil Sharma



[email protected] October 16th 08 09:17 AM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" isselected.
 
Hi Ken Slovak,

Is this version of Word from the same package and SKU as the Outlook
version?
Yes, word is from the same package as the outlook
version.

Is this a VSTO addin or a shared managed
code addin?
It is VSTO Addin

Are you deriving all of your Outlook objects from the Application
object
passed to you in your startup event handler (either Startup or
OnConnection)?
Yes, i am deriving all of my out look objects from the
application object passed to me in Startup

It looks strange to me too that i am getting
Inspector.IsWordEmail()==true and Inspector.WordEditor = null

Is there any Event available as "Activated", because i feel "Activate"
Event is fired before Inspector Activation. If i Receive this event
after Activation then i feel the proble will be resolved.

Thanks and Best Regards,
Nikhil Sharma

Ken Slovak - [MVP - Outlook] October 16th 08 02:54 PM

Can not add CommandBar if "Word 2003 to read Rich Text e-mail" is selected.
 
There's no such event, and I've never needed it.

I just use the first Inspector.Activate() event and in that event I check
for the Outlook version. If it's less than 12 (Outlook 2003 or earlier) and
..IsWordMail() == true I call to initiate my Word objects like this, where
"_insp" is my wrapper class level Inspector object, and "_doc" is a class
level Word.Document object:

_doc = (Word.Document)_insp.WordEditor;

That works just fine for me.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


wrote in message
...
Hi Ken Slovak,

Is this version of Word from the same package and SKU as the Outlook
version?
Yes, word is from the same package as the outlook
version.

Is this a VSTO addin or a shared managed
code addin?
It is VSTO Addin

Are you deriving all of your Outlook objects from the Application
object
passed to you in your startup event handler (either Startup or
OnConnection)?
Yes, i am deriving all of my out look objects from the
application object passed to me in Startup

It looks strange to me too that i am getting
Inspector.IsWordEmail()==true and Inspector.WordEditor = null

Is there any Event available as "Activated", because i feel "Activate"
Event is fired before Inspector Activation. If i Receive this event
after Activation then i feel the proble will be resolved.

Thanks and Best Regards,
Nikhil Sharma




All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com