TaskPane and OleContainer

Add-in Express™ Support Service
That's what is more important than anything else

TaskPane and OleContainer
TaskPanes are not visible when Word/Excel is in OleContainer 
Georgi Panayotov


Guest


Hello
Our application is using Word and Excel in OleContainer. But the Add-in express task panes are not visible. If the application opens the document outside the container (for example with excel - OleContainer.DoVerb(-2)) the task pane is visible, after returning back (DoVerb(-2) again) it disapears.

Do task panes support OleContainers?

I'm using Office 2013
Posted 23 Jun, 2014 16:01:50 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Georgi,

Georgi Panayotov writes:
If the application opens the document outside the container (for example with excel - OleContainer.DoVerb(-2)) the task pane is visible, after returning back (DoVerb(-2) again) it disapears.


This is the expected behavior of the OLE container; it is by Microsoft design. When the OLE container shows the OLE document non-activated, it actually shows an image, not the document.

There no support for the in-place activating the document in an Ole container.


Andrei Smolin
Add-in Express Team Leader
Posted 24 Jun, 2014 03:25:16 Top
Georgi Panayotov


Guest


Hello Andrei,

This is the expected behavior of the OLE container; it is by Microsoft design. When the OLE container shows the OLE document non-activated, it actually shows an image, not the document.

Yes, and for that reason we make call DoVerb(ovPrimary) and the we have a Word (or Excel) in our application window :)


There no support for the in-place activating the document in an Ole container.

Do you plan to add support to use task panes in OleContainer. The addin initializes but no task pane is shown. I know i can use a form, but panes are more elegant solution.

If i click on Find in a word document opened in OleContainer - Navigation pane appears on the edge.

Best regards
Georgi Panayotov
Posted 24 Jun, 2014 14:37:13 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Georgi,

We don't plan to support this. There are too many problems and restrictions. Say, we will need to decide on how to share the container window (which is typically small) among the embedded document's application window and Add-in Express panes. Also, all controls that you use on the pane must support OleContainer.

Georgi Panayotov writes:
If i click on Find in a word document opened in OleContainer - Navigation pane appears on the edge.


For a Word document embedded into an Excel sheet, the Navigation pane is shown in the Excel window, not in the container. Note that you can use the same approach and show the panes in application in which the container is embedded. What do you think?


Andrei Smolin
Add-in Express Team Leader
Posted 25 Jun, 2014 07:46:38 Top
Georgi Panayotov


Guest


Hello Andrei,
Sorry for my English language skills - maybe i was not clear about the usage of ole container in our application :) .

Just to clarify
We are using word and excel in TOleContainer control in a window of a Delphi application for only one (not very elegant) reason - to control when the user saves and closes the document, then we read some data from the document and put it in a database (with the document itself). The size of the ole container is just one title bar, one toolbar and 4 borders smaller than regular word or excel document - here is an example how it looks - a word window with extra Save,Cancel and Print buttons (excel window is almost the same)

http://www.ada-soft.bg/downloads/temp/screenshot_word_olecontainer.png

I just found an example .net application positioning word in application window (I think they using something else) and it shows task panes. I will try this solution, if not - i will try to use WinForm Forms and Ribbons to make it work.

Thanks

Best regards
Georgi Panayotov
Posted 25 Jun, 2014 10:13:40 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Georgi,

I understand your point about the size of your application. This is a secondary point however. The main restriction is the need for an arbitrary control on a pane to support OleContainer.

I would invest into studying Word and Excel events. Say, Excel 2010+ provides the WorkbookAfterSave event. In Word, you can try the approach given at http://davecra.com/2011/05/05/word-aftersave-event/ (personally, I don't like running a thread.

I believe using the BeforeSave/BeforeClose events and the Commandbars.OnUpdate event (it is mapped to the CommandbarsUpdate event, see ADXExcelAppEvents and ADXWordAppEvents components) should let you find the moment when the document is already saved and closed.


Andrei Smolin
Add-in Express Team Leader
Posted 26 Jun, 2014 08:01:32 Top
Georgi Panayotov


Guest


Hello Andrei,
Thanks for your answers.
I know that the usage of OleContainers has many drawbacks and is ugly way to do this job, but it was fast to develop.
For now we will use a form to make things work, and later try to make it with Events - actually i was thinking about this solution last evening, but is lot of work to make it how we want and will put this later in our roadmap.

Your framework is great, before it we have two versions for office 2003- (VBA Macros...) and 2007+ (VSTO), but was nightmare to support them :) and the transfer the functionality to ADX was a matter of hours.

Thanks
Best regards
Georgi Panayotov
Posted 26 Jun, 2014 09:06:41 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Georgi Panayotov writes:
but is lot of work to make


I know that even studying the events will take a lot of time: there's a number of scenarios plus several Office versions.

Thank you!


Andrei Smolin
Add-in Express Team Leader
Posted 26 Jun, 2014 09:35:38 Top