Using ADX from custom TaskPane UserContol

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

Using ADX from custom TaskPane UserContol
 
Jaquemet Olivier


Guest


Hi,

We have a custom taskpane user control which contains all the presentation logic for our Office .NET Addin (which must be compatible with Office 2003 and 2007).
This taks pane is defined in the TaskPanes properties of the addin module and it's working perfectly.


How can I retrieve the instance of MY user control from the Addin class ? (eg in the AddinInitialize event).


I need to be able to propagate some ADX events (such as adxWordEvents_DocumentBeforeSave) to my usercontrol.
How is it possible ?


Thanks for your help
Posted 23 Mar, 2009 06:19:22 Top
Eugene Astafiev


Guest


Hi Jaquemet,

You can use the following code:

If Me.HostVersion.Substring(0, 4) = "12.0" Then
   Dim TaskPaneInstance As _
      AddinExpress.MSO.ADXTaskPane.ADXCustomTaskPaneInstance = _
         AdxTaskPane1.Item(ExplorerOrInspector)
   If Not TaskPaneInstance Is Nothing _
      And TaskPaneInstance.Visible Then
      Dim uc As UserControl1 = TaskPaneInstance.Control
End If


Also please have a look at the Adding a Custom Task Pane in Office 2007 section in the documentation.
Posted 23 Mar, 2009 07:13:52 Top
Jaquemet Olivier


Guest


Thanks Eugene for this quick answer,

Unfortunately I could not find any method matching "Item(ExplorerOrInspector)" for the class AddinExpress.MSO.ADXTaskPane. Is it a public API...?

Also as stated in my original post, I need to be compatible with both Office 2003 and 2007. Does this code work in both version ?

Olivier

PS : I'm programming in C#... it would be very nice of you could provide future code sample in C# :)
Posted 23 Mar, 2009 07:30:59 Top
Eugene Astafiev


Guest


Olivier,

C#:

adxTaskPane1[ExplorerOrInspector]


Also as stated in my original post, I need to be compatible with both Office 2003 and 2007. Does this code work in both version ?


No, it doesn't. http://msdn.microsoft.com/en-us/library/aa338197.aspx article states the following:

The 2007 release of the Microsoft Office system introduces a programmable custom task pane that changes the way you develop solutions for documents in the 2007 release of the Microsoft Office system.

Instead you can use the Advanced Outlook view and forms regions. Please read more about this feature http://www.add-in-express.com/add-in-net/outlook-regions.php.
Posted 23 Mar, 2009 07:50:52 Top
Jaquemet Olivier


Guest


I could not found the constant ExplorerOrInspector, but anyway, if this solution is not compatible with 2003 and 2007 it is not the solution we are looking for.

But I'm starting to wonder : are you implying that the simple code you provided is not compatible with both version of Office, or that ADX taskpanes are not compatible with both version ?

As far as "Outlook view and forms regions" are concerned, I am developping an addin for Word, Excel and PowerPoint, so this is not the solution :(

What is the solution provided to develop a feature similar to TaskPane suitable for all version ?
Posted 23 Mar, 2009 12:12:55 Top
Eugene Astafiev


Guest


Oliver,

I could not found the constant ExplorerOrInspector, but anyway, if this solution is not compatible with 2003 and 2007 it is not the solution we are looking for.


This is just a piece of code from the documentation.

But I'm starting to wonder : are you implying that the simple code you provided is not compatible with both version of Office, or that ADX taskpanes are not compatible with both version ?


Unfortunately Office extensibility model doesn't provide such a feature.

What is the solution provided to develop a feature similar to TaskPane suitable for all version ?


What Office applications do you intend to support?
Posted 23 Mar, 2009 12:31:57 Top
Jaquemet Olivier


Guest


Word, Excel and PowerPoint
Posted 23 Mar, 2009 12:34:22 Top
Eugene Astafiev


Guest


Oliver,

The fifth version of Add-in Express will support these applications.
Posted 23 Mar, 2009 13:08:21 Top
Jaquemet Olivier


Guest


Do you have a release date for this version 5 ?
Will I be able to use it with the subscription we bought (associated to my email)?
Posted 24 Mar, 2009 15:51:06 Top
Eugene Astafiev


Guest


Hello Jaquemet,

Do you have a release date for this version 5 ?


We are planning to publish a new version in the middle of April.

Will I be able to use it with the subscription we bought (associated to my email)?


All customers who bought Add-in Express 2008 after December 15, 2008 will get a free upgrade to Add-in Express 2009 as soon as its first official release (not beta) is published.
Posted 25 Mar, 2009 04:51:10 Top