Visual Studio Development Bookmark and Share   
 index > Visual Studio Tools for Office > actionspanecontrol v.s. usercontrol
 

actionspanecontrol v.s. usercontrol

I am new to vsto 2005, and have a few questions.

1- is task pane and action pane the same thing ?

2- in creating a word project , I can do :

this.ActionsPane.Controls.Add(new UserControl1());

this.ActionsPane.Controls.Add(new ActionsPaneControl1());

is there only one actionpane for a word document, ? can we add more and how ?

3- what is the difference of usercontrol v.s. actionspanecontrol ?

thanks.

farsh  Wednesday, June 21, 2006 7:37 PM

I'm surprised that things continued to work after uninstalling VSTO2005. The VSTO v3 June CTP is supposed to be installed on top of VSTO2005. Some of the problems you're seeing might be because of that. I'd recommend installing VSTO2005 again and then installing the VSTO v3 June CTP after that.

Unlike the ActionsPane, CustomTaskPanes are application level and can be created via the VSTO v3 CTP add-in projects. So you should create an InfoPath add-in project (not an InfoPath doc level project).

There's a brief demo you can watch here: http://blogs.msdn.com/vsto2/that shows how to create custom task panes.

There's also some documentation about the custom task pane in the following VSTO v3 tutorial: http://download.microsoft.com/download/5/5/8/55826AC5-FF9A-461D-ABC3-477E9D1829A7/VSTOv3CTPTutorial.doc

Hope that helps!

Reza Chitsaz - MSFT  Thursday, June 22, 2006 8:52 AM
It doesn't map over all so simply. I'm sorry the docs aren't ready yet, so I'll say what I can here, but I can't help much more than this.

thisXDocument.View.SwitchView = ViewInfos.SwitchView

thisXDocument.UI.Alert = Windows.Forms.MessageBox

(Note that this doesn't work in browser forms so you'll want to use conditional formatting instead to show/hide messages, there's no code way to show dialog boxes from the server)

IXMLDOMDocument3 = System.Xml.XPathNavigator

(the old MSXML concepts are replaced by System.Xml, so this is where you'll have to do the most rewriting of your code)

thisXDocument.DOM.SelectSingleNode = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager);

(this is in my blog entry)

Ned Friend - Microsoft  Thursday, June 22, 2006 10:12 PM

The ActionsPane item is the same as a UserControl item. The reason we added the ActionsPane item was for discoverability/visibility reasons.

Yes, both lines of code will work.

Yes, there's only one ActionsPane per document in VSTO 2005. In Office12 and VSTO v3 you will be able to have multiple per document! Stay tuned! :-)

Reza Chitsaz - MSFT  Wednesday, June 21, 2006 8:03 PM

ok,

so , I had a version of VSTO 2005 and I had VSTO v3 June CTP at the same time , so it was confusing, ant took the VSTO 2005 out . , but I found out that the office projects could not be created , it was missing some class.. ?

therefore, I am working with the latest I assume..but a bit confusing..

Before, I get into the VSTO , I had an existing development on infopath 2003 that was working with Visual Studio 2003 and later with 2005, without the VSTO.

Now that I have this infopath application, I want to take advantageof the VSTO v3 and create custom task panes,

I know that in infopath2003 we had only one taskpanes[0] whichwas accessible , taskpanes[1-8] was referencing the exisitng taskpanes such as home, find, etc. ? is this right, ?

now If I want to create customtaskpanes, I saw an example that I was able to create this via Addin.

However, there is another type of project in vsto that should allow me to create an infopath project that should allow me to do create custom task panes as well,

When I do that, it asks me if I want to use an existing infopath template, which I do , but when the project is opened, I do not see any of my previous codes ? ,, and If I have to start over, it seems that I do not have all the right references ??

Is there an example for infopath and VSTO , and Customtaskpanes ?

farsh  Thursday, June 22, 2006 12:26 AM

I'm surprised that things continued to work after uninstalling VSTO2005. The VSTO v3 June CTP is supposed to be installed on top of VSTO2005. Some of the problems you're seeing might be because of that. I'd recommend installing VSTO2005 again and then installing the VSTO v3 June CTP after that.

Unlike the ActionsPane, CustomTaskPanes are application level and can be created via the VSTO v3 CTP add-in projects. So you should create an InfoPath add-in project (not an InfoPath doc level project).

There's a brief demo you can watch here: http://blogs.msdn.com/vsto2/that shows how to create custom task panes.

There's also some documentation about the custom task pane in the following VSTO v3 tutorial: http://download.microsoft.com/download/5/5/8/55826AC5-FF9A-461D-ABC3-477E9D1829A7/VSTOv3CTPTutorial.doc

Hope that helps!

Reza Chitsaz - MSFT  Thursday, June 22, 2006 8:52 AM

I did put VSTO v3 over VSTO2005 ,still some unanswered questions:

I am confused as to how to proceed with my infopath developmentwith VSTO,

there are 2 ways to write code for infopath :

a-without VSTO b- With VSTO

Question 1- I have existing code that was written for infopath without VSTO ,

when I try to now create an infopath template with VSTO using the existing project, I loose the form code ?

Question 2- with VSTO , instead, I get the following in the form code:

public partial class FormCode

public void InternalStartup()

Even when I bring my oldcode and fix all the references which was lost while bringing in to VSTO , I still get errors from the manifest..

farsh  Thursday, June 22, 2006 5:17 PM

Just to make sure we're on the same page, it sounds like you wrote your old code using InfoPath 2003 with the Visual Studio 2003 Toolkit found here:

http://www.microsoft.com/downloads/details.aspx?familyid=7E9EBC57-E115-4CAC-9986-A712E22879BB&displaylang=en

And now you've installed the Visual Studio 2005 Toolkit that comes with VSTO 2005, found here:

http://msdn.microsoft.com/office/understanding/vsto/

And finally you installed VSTO v3, as found here:

http://www.microsoft.com/downloads/info.aspx?na=22&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d68978824-ca55-4208-a55e-5c4858183b31%26DisplayLang%3den

Including the InfoPath piece which is included here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=00779894-e95f-4b22-8590-07584c891207&DisplayLang=en

To Question 1:

You should be able to double click your solution file to open it in VS, and all your code should remain there. If you create a new InfoPath project instead and then point to the old project, we'll copy the form but not the code.

To Question 2:

Once you open the solutiondirectly, your code should just work.

Ned Friend - Microsoft  Thursday, June 22, 2006 6:03 PM

ok,

I am finding that when you create an infopath template with VSTO , you have a whole bunch of differences in the way the events are handled, and organized, like before, I had control_Onafterchange(), and now we have control_Changed().

I am trying to take advantage of the VSTO ? is there any if I convert my code to the new format ??

farsh  Thursday, June 22, 2006 6:57 PM

That's the new object model for InfoPath 2007, but the old object model is still supported.

Go to the "Form Options" dialog (it should be on the Tools menu) and change the language to the C# or Visual Basic language with "(2003 compatible)" on it.

Then get your code working again and if you want to upgrade it to the new OM you can click the Upgrade button in the same Form Options location.

Ned Friend - Microsoft  Thursday, June 22, 2006 7:11 PM

I didthe conversion on my previously working project .

now everywhere there was code , I have this:

#if InfoPathManagedObjectModel

am I supposed to set this, or should it be a setting in the infopath ?

farsh  Thursday, June 22, 2006 7:43 PM
This is set by InfoPath, but it is always false and only there as a way to comment out your old code. You need to copy all your code to the new event handlers and rewrite it to work with the new object model. What upgrade did was hook up the same event handlers for you can just update the code you wrote without having to update the code InfoPath had automatically generated for you.
Ned Friend - Microsoft  Thursday, June 22, 2006 8:45 PM

I found the following blog that has some tips but no where near what has to change ..

http://blogs.msdn.com/infopath/archive/2006/06/06/619143.aspx

can you provide me with a complete list, ?

here is a number of unique errors that I could get help on:

'EmailAdapter' could not be found'

thisXDocument.UI.Alert

'DAVAdapter' could not be found

WebServiceAdapter2' could not be found

IXMLDOMNodelist could not be found

farsh  Thursday, June 22, 2006 9:09 PM

Cool, glad you found that since I actually wrote that blog entry.

Unfortunately our full documentation isn't ready yet, so I recommend using the old object model for now. You don't need to upgrade your OM to work with InfoPath 2007. You only need to upgrade it if you want to run your form in the browser using the Microsoft Office SharePoint Server.

If you must update your code, your best bet is to use the Object Browser in VS and find the closest matches.

Ned Friend - Microsoft  Thursday, June 22, 2006 9:16 PM

That is the main reason , I want to change it..

can you provide conversions for :

thisXDocument.View.SwitchView

thisXDocument.UI.Alert

IXMLDOMDocument3

thisXDocument.DOM.SelectSingleNode

farsh  Thursday, June 22, 2006 9:52 PM
It doesn't map over all so simply. I'm sorry the docs aren't ready yet, so I'll say what I can here, but I can't help much more than this.

thisXDocument.View.SwitchView = ViewInfos.SwitchView

thisXDocument.UI.Alert = Windows.Forms.MessageBox

(Note that this doesn't work in browser forms so you'll want to use conditional formatting instead to show/hide messages, there's no code way to show dialog boxes from the server)

IXMLDOMDocument3 = System.Xml.XPathNavigator

(the old MSXML concepts are replaced by System.Xml, so this is where you'll have to do the most rewriting of your code)

thisXDocument.DOM.SelectSingleNode = MainDataSource.CreateNavigator().SelectSingleNode(xpath, NamespaceManager);

(this is in my blog entry)

Ned Friend - Microsoft  Thursday, June 22, 2006 10:12 PM

thanks a lot that reduced my errors quite a bit,

I am going to list the rest, so , if you do have a chance i appreciate the response.

thisXDocument.GetDOM

thisXDocuement.DataObjects

farsh  Thursday, June 22, 2006 10:45 PM

thisXDocument.GetDOM("NAME") = XmlForm.DataSources("NAME").CreateNavigator()

thisXDocuement.DataObjects = XmlForm.DataSources

Hope that helps!

Ned Friend - Microsoft  Monday, June 26, 2006 9:55 PM

You can use google to search for other answers

Custom Search

More Threads

• Office word typed in word compare
• Print an excel file
• Italian version of VSTO 2005: text in Information Window is truncated (inside "?" Main Menu)
• Xml Toolbox issue
• Problems Closing Excel Interop
• "Lock" table cells
• office tool bar
• Install vsto 2005
• Is it possible to host outlook calendar in a winform app?
• Need Help; Insert images to the end of a Word Document