From: John Malden on
[I have also posted this on the answers.Powerpoint forum]

Office Version:Office 2010
Operating System:Windows XP
Program:PowerPoint

We have a COM addin in VB6 for Office 2000, 2003 & 2007. The 2007
version successfully has a Ribbon interface and CustomTaskPanes that are
accessible for all open presentations (using ICustomTaskPaneConsumer).

However, PowerPoint 2010 has a fundamental change in that
CustomTaskPanes (CTPs) are loaded for each open presentation. This is
supposed to be done now using the PresentationOpen, WindowActivate
events among others.

http://msdn.microsoft.com/en-us/library/bb264456.aspx explains more.

My problem is simple - I can't seem to reference the CustomTaskPanes
collection from VB6 (the CustomTaskPaneCollection.Add method). Is it
hidden? Do I need to reference a specific DLL? Any help would be greatly
appreciated.

John
From: "Jon Lewis" jon.lewis on
I created a VB6 Add-in a couple of years ago to generate a CustomTaskPane
for an Access 2007 application and remember I had big trouble figuring out
how to do this as all available examples used VB("The Imposter") as opposed
to VB6 (if you are not a regular visitor to this NG then be aware that Hell
Hath No Fury like the hatred of "the framework" here! :)

Eventually I managed to figure out a solution that seems to work by looking
at some old MSDN articles on how to create a VB6 com add-in and looking at
the VS.Fred based CRP creation documents.

I don't have access to my source code at the moment but I seem to remember
that the way VB6 works in this respect is that you have to have a User
Control to host the CTP.

IIRC you set a refernce to the add-in in the office app and then call the
Connet method of the add-in which invokes the add-in's 'Connect' designer
object. I do have the following (cut down) code handy from this object
which I posted in reply to another post some time ago:

Option Explicit
Implements IDTExtensibility2
Implements ICustomTaskPaneConsumer
Public WithEvents ssCTP As CustomTaskPane

Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal CTPFactoryInst
As Office.ICTPFactory)
Set ssCTP = CTPFactoryInst.CreateCTP("SSCRMctpActiveX.ucCTP", "Title")
ssCTP.DockPosition = msoCTPDockPositionLeft
ssCTP.DockPositionRestrict = msoCTPDockPositionRestrictNoChange

"SSCRMctpActiveX.OCX" is the name of the add-in
"ucCTP" is the name of the User Control in the add-in

Unless you know different I don't think VB6 gives you access to the Office
app's CustomTaskPanes collection, you need VS.Fred for this.

If I'm wrong about this I'd be interested to know. Did you write this COM
add-in yourself? If so (or you have access to the source code), I'd be
interested in the CTP creation code as I've never had anything to benchmark
my solution with.

Jon





"John Malden" <johnmalden(a)hotmail.com> wrote in message
news:e1zMdo1ILHA.5700(a)TK2MSFTNGP04.phx.gbl...
> [I have also posted this on the answers.Powerpoint forum]
>
> Office Version:Office 2010
> Operating System:Windows XP
> Program:PowerPoint
>
> We have a COM addin in VB6 for Office 2000, 2003 & 2007. The 2007 version
> successfully has a Ribbon interface and CustomTaskPanes that are
> accessible for all open presentations (using ICustomTaskPaneConsumer).
>
> However, PowerPoint 2010 has a fundamental change in that CustomTaskPanes
> (CTPs) are loaded for each open presentation. This is supposed to be done
> now using the PresentationOpen, WindowActivate events among others.
>
> http://msdn.microsoft.com/en-us/library/bb264456.aspx explains more.
>
> My problem is simple - I can't seem to reference the CustomTaskPanes
> collection from VB6 (the CustomTaskPaneCollection.Add method). Is it
> hidden? Do I need to reference a specific DLL? Any help would be greatly
> appreciated.
>
> John

From: John Malden on
Thanks for the reply Jon. I did not write the add-in myself, I placed
this post on his behalf. He is away until next week on holiday but I am
sure he will be able to provide the CTP code he used successfully for
office 2007.

Unfortunately, MS have "moved the goalposts" on us yet again and that
technique does not work for office 2010. Instead of the CTP being a
global item available for all documents, there is now a CTP collection,
one CTP for each document. We can't seem to access this collection at
all with VB6

John

On 17/07/2010 16:45, Jon Lewis <jon.lewis wrote:
> I created a VB6 Add-in a couple of years ago to generate a
> CustomTaskPane for an Access 2007 application and remember I had big
> trouble figuring out how to do this as all available examples used
> VB("The Imposter") as opposed to VB6 (if you are not a regular visitor
> to this NG then be aware that Hell Hath No Fury like the hatred of "the
> framework" here! :)
>
> Eventually I managed to figure out a solution that seems to work by
> looking at some old MSDN articles on how to create a VB6 com add-in and
> looking at the VS.Fred based CRP creation documents.
>
> I don't have access to my source code at the moment but I seem to
> remember that the way VB6 works in this respect is that you have to have
> a User Control to host the CTP.
>
> IIRC you set a refernce to the add-in in the office app and then call
> the Connet method of the add-in which invokes the add-in's 'Connect'
> designer object. I do have the following (cut down) code handy from this
> object which I posted in reply to another post some time ago:
>
> Option Explicit
> Implements IDTExtensibility2
> Implements ICustomTaskPaneConsumer
> Public WithEvents ssCTP As CustomTaskPane
>
> Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal
> CTPFactoryInst As Office.ICTPFactory)
> Set ssCTP = CTPFactoryInst.CreateCTP("SSCRMctpActiveX.ucCTP", "Title")
> ssCTP.DockPosition = msoCTPDockPositionLeft
> ssCTP.DockPositionRestrict = msoCTPDockPositionRestrictNoChange
>
> "SSCRMctpActiveX.OCX" is the name of the add-in
> "ucCTP" is the name of the User Control in the add-in
>
> Unless you know different I don't think VB6 gives you access to the
> Office app's CustomTaskPanes collection, you need VS.Fred for this.
>
> If I'm wrong about this I'd be interested to know. Did you write this
> COM add-in yourself? If so (or you have access to the source code), I'd
> be interested in the CTP creation code as I've never had anything to
> benchmark my solution with.
>
> Jon
>
>
>
>
>
> "John Malden" <johnmalden(a)hotmail.com> wrote in message
> news:e1zMdo1ILHA.5700(a)TK2MSFTNGP04.phx.gbl...
>> [I have also posted this on the answers.Powerpoint forum]
>>
>> Office Version:Office 2010
>> Operating System:Windows XP
>> Program:PowerPoint
>>
>> We have a COM addin in VB6 for Office 2000, 2003 & 2007. The 2007
>> version successfully has a Ribbon interface and CustomTaskPanes that
>> are accessible for all open presentations (using
>> ICustomTaskPaneConsumer).
>>
>> However, PowerPoint 2010 has a fundamental change in that
>> CustomTaskPanes (CTPs) are loaded for each open presentation. This is
>> supposed to be done now using the PresentationOpen, WindowActivate
>> events among others.
>>
>> http://msdn.microsoft.com/en-us/library/bb264456.aspx explains more.
>>
>> My problem is simple - I can't seem to reference the CustomTaskPanes
>> collection from VB6 (the CustomTaskPaneCollection.Add method). Is it
>> hidden? Do I need to reference a specific DLL? Any help would be
>> greatly appreciated.
>>
>> John
>

From: James Burrell on
Hi Jon

You're about spot on with your example code. The only extra thing I do
is create a withevents reference to my Activex control (which will be
contained in the taskpane) and during creation of the custom taskpane,
set it to the .ContentControl of the CustomTaskPane object. This allows
you access to the underlying control which is rather important!

As for access to the CustomTaskPanes collection, if I need VS.Fred for
this, I wonder if a simple dll could expose the object to VB6. In any
case, the fact that a different taskpane object is needed for each open
presentation means that keeping them all updated will be very messy. Why
am I not surprised?

James

Jon Lewis <jon.lewis wrote:
> I created a VB6 Add-in a couple of years ago to generate a
> CustomTaskPane for an Access 2007 application and remember I had big
> trouble figuring out how to do this as all available examples used
> VB("The Imposter") as opposed to VB6 (if you are not a regular visitor
> to this NG then be aware that Hell Hath No Fury like the hatred of "the
> framework" here! :)
>
> Eventually I managed to figure out a solution that seems to work by
> looking at some old MSDN articles on how to create a VB6 com add-in and
> looking at the VS.Fred based CRP creation documents.
>
> I don't have access to my source code at the moment but I seem to
> remember that the way VB6 works in this respect is that you have to have
> a User Control to host the CTP.
>
> IIRC you set a refernce to the add-in in the office app and then call
> the Connet method of the add-in which invokes the add-in's 'Connect'
> designer object. I do have the following (cut down) code handy from
> this object which I posted in reply to another post some time ago:
>
> Option Explicit
> Implements IDTExtensibility2
> Implements ICustomTaskPaneConsumer
> Public WithEvents ssCTP As CustomTaskPane
>
> Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal
> CTPFactoryInst As Office.ICTPFactory)
> Set ssCTP = CTPFactoryInst.CreateCTP("SSCRMctpActiveX.ucCTP", "Title")
> ssCTP.DockPosition = msoCTPDockPositionLeft
> ssCTP.DockPositionRestrict = msoCTPDockPositionRestrictNoChange
>
> "SSCRMctpActiveX.OCX" is the name of the add-in
> "ucCTP" is the name of the User Control in the add-in
>
> Unless you know different I don't think VB6 gives you access to the
> Office app's CustomTaskPanes collection, you need VS.Fred for this.
>
> If I'm wrong about this I'd be interested to know. Did you write this
> COM add-in yourself? If so (or you have access to the source code), I'd
> be interested in the CTP creation code as I've never had anything to
> benchmark my solution with.
>
> Jon
>
>
>
>
>
> "John Malden" <johnmalden(a)hotmail.com> wrote in message
> news:e1zMdo1ILHA.5700(a)TK2MSFTNGP04.phx.gbl...
>> [I have also posted this on the answers.Powerpoint forum]
>>
>> Office Version:Office 2010
>> Operating System:Windows XP
>> Program:PowerPoint
>>
>> We have a COM addin in VB6 for Office 2000, 2003 & 2007. The 2007
>> version successfully has a Ribbon interface and CustomTaskPanes that
>> are accessible for all open presentations (using
>> ICustomTaskPaneConsumer).
>>
>> However, PowerPoint 2010 has a fundamental change in that
>> CustomTaskPanes (CTPs) are loaded for each open presentation. This is
>> supposed to be done now using the PresentationOpen, WindowActivate
>> events among others.
>>
>> http://msdn.microsoft.com/en-us/library/bb264456.aspx explains more.
>>
>> My problem is simple - I can't seem to reference the CustomTaskPanes
>> collection from VB6 (the CustomTaskPaneCollection.Add method). Is it
>> hidden? Do I need to reference a specific DLL? Any help would be
>> greatly appreciated.
>>
>> John
>
 | 
Pages: 1
Prev: MSComm
Next: Access 2000 limitations