New Visual Studio 2005 Tools for Office

The Visual Studio 2005 Tools for Office brings a host of new additional enhancements to the solutions that can be made. These tools can enhance the way you use the Word, Excel, Outlook and InfoPath. With these tools you can separate the data and the view elements for different types of scenarios.


You can also add business logic to the forms that you build. This is achieved with the support for InfoPath. This business logic is added using the managed code and not script. Since you use managed code it is possible to create advanced business logics and tasks. Integration of these tools in Visual Studio means that you have access to the IntelliSense feature that helps you to create codes faster. Help support through F1 is also available.

In the Visual Studio 2005 Tools for Office new templates are available in the Office subfolder after you select the projects folder. Templates for Excel, InfoPath and Outlook are added in the Visual Studio 2005 Tools for Office. In this product you have code files for all the worksheets that you have in the excel sheet and there is one code file for the workbook. You can see the list of worksheets in the Solution Explorer. For the Word documents you have one code file.

With the Visual Studio 2005 Tools for Office you can open the Word or the Excel sheet in the Visual Studio designer and work with that environment as if you are working in the windows forms. Once you have opened them in the designer you can write managed code for them and change the look in a way you want. This is also like working with the windows forms.

It is easy to edit them in the visual designer the way you want. You can change the keyboard mapping to that of the office application. By default it will be like that of the Visual Studio. Go to the Tools options and select Microsoft Office Tools Keyboard Setting and use the Change Keymapping feature. The toolbars of Word or Excel that appear in the Designer are fully functional. You might note that not all the functions of Office are available in that.

Only that are applicable to be used in the Visual Designer are available for your use. Check the Tools and the View menu to find that out. When you open a document or excel sheet in the visual designer it is available in the design mode. You can make the changes to the document needed and save. To use the new document that you have now changed you have to open them outside Visual Studio using the respective application.

New Word and Excel Host controls are available in addition to the windows forms controls. The host controls have an event model associated with them and data binding is possible with the host controls. Just like you work with other applications you can drag and drop the windows forms control on to the Word or Excel document that is opened in the design view.

You can even use the Properties window to modify those control’s properties. Some differences are there in the way the controls work. You cannot set the tab order for the controls that you place in the document. Moreover you cannot group the controls like radio buttons. You have to write codes for them to make them mutually exclusive. As you work earlier you can double click a control to open the code view for that particular control. Some of the controls that are added to the component tray are not visible in the document.

Host controls can bind data to them and they even expose events associated with the controls. Some of the host controls that are available for Word are Bookmark, XMLNode, and XMLNodes. The host controls for Excel are NamedRange, XMLMappedRange, ListObject, and Chart. Host controls are treated as extended office objects and they can be added in many ways to the document. One of the ways to add a host control is to use the design time and add.

You can use the Insert menu and insert a Bookmark control in a word document. You can use the methods, properties and events associated with that control to program that control according to your specific needs. Another way to add a host control is to use the toolbox. Navigate to the control in the toolbox and just drag the controls to the documents. In the toolbox there are two tabs called the Excel controls tab and the Word Controls tab.

You can click those tabs to see the host controls available for that category. One other way is to use the data sources window and drag the host controls that are bound to the data, on to the document and the excel sheet. The last method to add host controls is to dynamically create them using code so that they are added during runtime. The controls that can be dynamically created are the Bookmark, Chart, NamedRange and the ListObject control.

Smart tags are also available with Visual Studio 2005 Tools for Office. It is easy to add smart tags and program them. Writing code for smart tags is also easy with the IntelliSense feature available. The support for regular expression and integrate help feature enables smart tag programming easier. There is a separate class that has all the codes necessary to create a smart tag. Smart tags are scoped to that particular document alone. This means that same type of smart tags have different meanings and actions for different documents.

Custom task panes can be created using the ActionsPane object. Custom actions can be programmed for the different controls in the action pane. The actions pane is like a container that can have different forms control or user controls. A typical way to add control to the action pane is to add the forms control to a user control and then add the user control to the action pane. It is also possible to dynamically add controls to the action pane. This could even be in response to the user actions.

With the Visual Studio 2005 Tools for Office you can separate data from the document view. You can program using native .net types. By this you can extend the features of the application. You can embed data as data islands. You can use the programming model to interact with the XML data islands. Data binding between the view and the data island is achieved through programming.

An XML schema based model is used for binding data. For data binding you can also use the data sources window available in Visual Studio 2005 Tools for Office. Simple and Complex data binding is possible with the host controls. When data is available in data islands, it means that these data are even accessible in offline scenarios. The data island is a cached data that is bound to the document when it is first requested from the server. It is possible for the user to change the data and then reflect the changes to the data source itself when the user connects online. For data caching the CachedAttribute is used.

With the ServerDocument class and server-side programming you can modify the data without even opening up the office environment. The data thus changed can be viewed using office applications. In this scenario the office applications are used as a client application for only viewing the data. You can modify the data in the server without opening up any office application. When the user opens the office document, the data island embedded in the document is synchronized with the changed data in the server and the updated data is presented to the user.

A new project type called the InfoPath project is available in the Visual Studio 2005 Tools for Office. This can be used for including any business logic to the InfoPath forms. Advanced processing can be done using such features. For example encryption and decryption and digital signal processing can be done. You can program this project using your favorite Visual Basic .Net or C#. InfoPath is a data centric model. The data for InfoPath in the XML form and code are written to interact with this data. Several security settings are available for the InfoPath template. Settings like “Restricted”, Domain”, and “Full Trust” can be used.

Add-Ins for Outlook is available in Visual Studio 2005 Tools for Office. The outlook add-in will not open in the designer and it does not have any host controls associated with it. A separate AppDomain is added for each add-in. The mechanism is the same at the application and the document level.
For more information on the Visual Studio 2005 Tools for Office do check the MSDN documentations available for this product at the Microsoft website.


“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.