Hi.
I've been developing Office solutions int .Net for about a year now. My company had some proprietary code that was letting us place user controls in Word (Document Map) but it's time to phase that hack out with Office 2007 coming.
So I downloaded VSTO (the version currently distributed) and installed it. Then I started looking around for code samples how to attach a custom Actions Pane.
It appears that if I start an Word 2007 project in VS2005 there is ActionsPane but if the project is for Word 2003 - there is no such property and no obvious way of getting a public property that would do. I'm not sure if I'm doing something incorrectly and it seems more and more frustrating after 3 days of digging around.
After initial attempts I went to greater lengths - I looked at the VSTO DLLs through Reflector, and I came across an ActionsPane class (in Microsoft.Office.Tools) with this constructor:
public ActionsPane(IHostItemProvider hostItemProvider, IRuntimeServiceProvider runtimeServiceProvider, string primaryCookie, object container, string identifier);
The constructor has the same parameters as the AddIn class (the class inherited by ThisAddin - the one that comes from the template). When I create ActionsPane instance with this constructor adding a control to it throws "not supported" exception" ...
My questions - is the help and code samples available on MSDN related to an older version of VSTO Is there something I'm missing
Ultimately: How do I make this Actions Pane appear ThisDocument_Startup is mentioned everywhere in postings but I couldn't figure out where it is - I only have ThisAddin_Startup

Ok... resolution...
nishanttheone
As I continue my search I downloaded and installed
"Visual Studio 2005 Tools for Office: Understanding the Word Object Model Sample" from
http://www.microsoft.com/downloads/details.aspx familyid=DA039BA4-B7C2-4F99-A45A-0B210299C2B7&displaylang=en
... VS2005 can't even open the solution and shows "The application for the project is not installed".
Looking at the code samples directly I see the "ThisDocument_Startup" method and "ActionsPane.Add" in it, but I don't see any other files for this class (it's partial).
I guess my question would be - which one is the applicaition I should install It's clearly not the beta that's on the VSTO site. Or is there a way to achieve the same with the beta
Bilberry71
I uninstalled VSTO SE Beta, looked through our MSDN disks and found the release version.
Now I can see the panel, ThisDocument and everything else. If now I can figure out how to attach my panel (programatically) to existing documents via toolbar click it will be great :).
I guess that part will be easier, but it's Friday evening.... so... :)
It doesn't look like it's intentional to leave the ActionsPane out from the beta though. Is it
search and deploy
Hi Sten
Speaking now only of VSTO 2005: There is a document-level ActionsPane. This derives from the Office 2003 support for SmartDocument technology. VSTO packages this up, making it very easy to use.
This ActionsPane is not the same thing as the CustomTask Pane being introduced in Office 2007. Only Office 2007 will be able to show a CTP.
It's unclear to what you're referring with "my panel", but if this is something you developed using the SE Beta, you won't be able to use it with the current VSTO 2005.
The beta for Office 2007 has two parts: "Cypress" (the 2005 SE beta open to the public for downloading and testing) and "Orcas". Cypress focuses on the support for creating application-level COM Add-ins for Office applications. Orcas will be the next version for document-specific solutions, like the Word and Excel things currently in VSTO 2005. This beta is currently not public.
jmurray_mi
Iwin
ZopoStyle
Thanks so much for the quick response. Yes, I came to that conclusion very, very late yesterday.
The problem is, the Actions Pane *is* programmable: you just need to program it using document code behind. Thats where I was getting confused. The books I have on the subject don't make it clear that add-ins are totally separate from code-behind documents, and the code they are providing only work with the code-behind projects.
I guess now my question is twofold:
1: Does the object model that Office exposes for document code-behind significantly different than the model it exposes for addins I know that the ActionsPane isn't the same
2: For Office 2007, does VSTO 2005 SE still generate COM addins Or is Office 2007 more sophisticated by deeply integrating with managed CLR assemblies
Thanks again for your response. Things are becoming clearer now..
Blkbird
Hi Mike
1. The document-level customizations base their Actions Pane on the ISmartDocument interface introduced with Office 2003. In a nutshell, this lets you link a "solution" (DLL that implements the interface) with an XML schema, that's linked to a document. The implementation defines an Actions Pane, and its content is context-sensitive to XML tags inserted into the document from the schema. VSTO takes care of all the implementation for you, in the background. Since SmartDocuments are document-specific, the Actions Panes must be, as well.
In Office 2007, the custom task panes are something integrated into Office, rather than being a separate interface that Office supports.
2. Yes, VSTO 2005 SE supports only COM Add-ins, for both versions of Office. Office 2007 is no different than previous versions in this respect - all the "core apps" are still COM and VB6-based (VBA), built around the same core code. InfoPath is the closest to the .NET world - it's programming language is VSTA rather than VBA.
The main difference for developers in 2007 vs. earlier versions is that they make it easier to generate and read documents with the OpenXML file formats. And associated with that is the RibbonUI. A Word or Excel installation is therefore not required to do anything with the documents content and UI.
mikebk
The ActionsPane is not something that is available to me when creating a project using 'Word 2003 AddIn' project.
It's easy for me to reproduce: simply create a new project using the template, and then try to reference the ActionsPane.
There is no 'ThisDocument' -- only 'ThisAddIn'.
I've scoured the net but this is the only time I've found someone encounter the same problem I have. What is the solution
I'm using VSTO 2005 release and VSTO 2005 SE.
Thanks!!
erick_the_redd
CaRNaGe_46038
The MSDN CD is from March 2006. It has "embedded C++ with SP2", office infopath toolkit for VS, access toolkit, Visual FoxPro and VSTO.
The disk is with yellow edge, lighter background: █ |
JohnGrabau
http://msdn2.microsoft.com/en-us/library/zzf9223t.aspx
This documentation sais:
"When you create a Microsoft Office Word 2003 application, Microsoft Visual Studio 2005 Tools for the Microsoft Office System automatically creates a Document host item within the project. You reference the Document host item using ThisDocument."
... well... I still can't find it
marina B.
All other versions besides "Microsoft Visual Studio 2005 Tools for the Microsoft Office System" (VSTO 2005 in short) are still in beta, unfinished preview versions, the documentation you find on the MSDN library is refering to VSTO 2005 (Or VSTO 2003 in some specific cases).
As you are using your VSTO version in combination with Word 2007 I assume you are using one of the beta products (Cypress, VS 2005 SE).
If you are trying to learn the product I would advise you to get the released "Microsoft Visual Studio 2005 Tools for the Microsoft Office System" version and use this with the large amount of examples and showcases that are out there for VSTO 2005.
-= Maarten =-
Aaron Leiby
Thank you,
but where do I get the released or older version from and how do I know which documentation refers to what version of VSTO
I'm using the beta along with Word 2003. When I start a Word 2007 project the ActionsPane property is there (I haven't tried it if it works) but when I start Word 2003 project - it's not.
vtortola
Thanks for the explanation of "Cypress" and "Orcas"
I still need to figure out how to attach my panel (that is - my UserControl) to the ActionsPane for any document.
Even though VSTO 2005 utilizes SmartDocument technology, there must be a way to attach the smart document with another app (COM plugin) so that I can see the my app's panel when there is a document open that did not come from specific template. There must be some way - attaching schema is one thing to start with but it doesn't enable the SmartDoc to the doc...
Hemantkum
This question has been asked many times in this forum. What you're looking for isn't possible because Office 2003 doesn't provide for customizable application-level task panes. This was introduced in Office 2007.
There have been discussions in the newsgroup interface about positioning a form over a docked commandbar. You can do a Google Groups search in the office.developer and word.vba.general newsgroups. Links to those groups can be found in the Please Read First message at the top of this forum.