.comment-link {margin-left:.6em;}

Pranav Wagh's Blog

Tuesday, December 27, 2005

Things to remember while designing a VSTO 2005 project.

Programmatic Limitations of Host Controls

l       For each host item and host control there is an underlying native Word or Excel object which can be accessed via the InnerObject property of the host item or host control.  You cannot however, cast a native object to it’s host item or host control.

l       Host items are not created automatically when you create a new document or worksheet at runtime.  For example, if you add a Word document at run time, it will be of the type Microsoft.Office.Interop.Word.Document rather than Microsoft.Office.Tools.Word.Document.

l       Host controls and Windows Forms controls cannot be added to a native Word document or Excel worksheet, they can only be added to a host item.

l       Most methods and properties of host items return the underlying native Office object upon which the item is based

l       VSTO does not provide individual collections for each type of host control.  For example, it is not possible to enumerate each Microsoft.Office.Tools.Word.Bookmark control in the document using the Microsoft.Office.Interop.Word.Bookmarks collection.  You can use the ControlCollection to iterate through all controls (host controls and Windows Forms controls) on the document and then look for items that match the type of host control that you are interested in

l       In Microsoft Word, you can pass a host control to a method or property that requires a native Word object for which there is a corresponding host control.  However, in Excel, you must pass the native Office object rather than the corresponding host control.  You can use the InnerObject property of the host control to pass the native Office object

l       If a user deletes or cuts a control from the document at run time, the control cannot be restored by using the Undo or Paste methods.  The Undo and Paste operations will add the underlying native Office object back to the document, but the object is no longer a host control.

 

Managed Windows Forms Controls

l       Controls can be added either manually or programmatically

l       Controls can be added to a Windows form, the actions pane, or directly on the document.

l       Windows Forms controls are not supported inside of a header or footer, or within a subdocument.

 

The following controls and components are not available in the Toolbox and are not supported for use on documents in VSTO 2005:

l       BindingNavigator

l       ContextMenuStrip

l       CrystalReportViewer

l       DataGrid

l       DirectoryEntry

l       DirectorySearcher

l       ErrorProvider

l       EventLog

l       FileSystemWatcher

l       FlowLayoutPanel

l       GroupBox

l       MainMenu

l       MenuStrip

l       MessageQueue

l       NotifyIcon

l       PageSetupDialog

l       Panel

l       PerformanceCounter

l       PrintDialog

l       PrintDocument

l       PrintPreviewControl

l       Process

l       RichTextBox

l       SerialPort

l       ServiceController

l       SplitContainer

l       Splitter

l       StatusBar

l       StatusStrip

l       TabControl

l       TableLayoutPanel

l       System.Timers.Timer

l       System.Windows.Forms.Timer

l       ToolBar

l       ToolStrip

l       ToolStripContainer

l       ToolStripDropDown

l       ToolStripDropDownMenu

l       ToolStripPanel

 

 

Unsupported methods and properties of Word controls

l       Hide

l       Show

l       Anchor

l       Dock

l       Location

l       TabIndex

l       TabStop

l       TopLevelControl

l       Visible

 

Unsupported methods and properties of Excel controls

l       Anchor

l       Dock

l       Location

l       TabIndex

l       TabStop

l       TopLevelControl

 

 

 

 

 

Installation Requirements for VSTO 2005

Installation Requirements for the Development System

l       One of the Microsoft Visual Studio 2005 Team System Software Editions or Microsoft Visual Studio 2005 Tools for Office

l       One of the following editions of Microsoft Office 2003 with Service Pack 1 or later.

l       Microsoft Office Professional Edition 2003.

l       Microsoft Office Professional Enterprise Edition 2003.

l       Microsoft Office Excel 2003.

l       Microsoft Office Word 2003.

l       Microsoft Office Outlook 2003.

l       Microsoft Office Professional Edition 2003 Trial.

l       Microsoft Office System Evaluation 2003 Enterprise Edition.

l       The Office 2003 Primary Interop Assemblies (PIAs), installed in the Windows global assembly cache (GAC).

l       Visual Basic for Applications (VBA) must be installed as part of Office.

 

Installation Requirements for the Client System

l       Microsoft .NET Framework, version 2.0

l       Visual Studio 2005 Tools for Office runtime

l       One of the following editions of Microsoft Office 2003 with Service Pack 1 or later

l       Microsoft Office Professional Edition 2003.

l       Microsoft Office Professional Enterprise Edition 2003.

l       Microsoft Office Excel 2003.

l       Microsoft Office Word 2003.

l       Microsoft Office Outlook 2003.

l       Microsoft Office Professional Edition 2003 Trial.

l       Microsoft Office System Evaluation 2003 Enterprise Edition.

l       The Office 2003 Primary Interop Assemblies (PIAs), installed in the Windows global assembly cache (GAC).

l       Visual Basic for Applications (VBA) must be installed as part of Office.

l       The appropriate security policies.

Tuesday, December 20, 2005

Stuck In A Question ..!!!

Stuck on a question!! can otkperst.dll can be redistributed, as its persistence control some guys are using it in their app and want to redistribute it I saw a blog http://www.kintespace.com/rasxlog/?p=217  that talks about the same thing, so now it’s a contest…..give your suggestionand win(??) your name on my three blogs  MSN, MSDN & Blogspot, I will even try to put your name on my bloglines one if I do manage to remember the password…J  

Refactor! for Visual Basic 2005

"Refactor! takes an innovative approach to refactoring that complements the Visual Basic development style. We're excited to make their solution available to Visual Basic 2005 developers."

Rob Copeland,
Visual Basic Product Unit Manager

 

Simplify Your Visual Basic Code

More and more developers are recognizing that simple, easy-to-read code is the key to application flexibility and easy maintenance. Managers are realizing that easy maintenance means low cost maintenance. If you know in your heart that parts of your code base could be better, but uncertainty about maintenance cost or concerns over breaking code have kept you from cleaning up your house, then Refactor! is for you. Refactor vaporizes barriers to code simplification, dramatically reducing the cost traditionally associated with improving, simplifying, and refactoring existing code.

*                  To perform an extract method, just select the block of code you want to extract, and press the Refactor Key.

*                  To reorder parameters, place the cursor on the type of the parameter and press the Refactor Key.

*                  To create a method overload, place the cursor at the start of the method declaration and press the Refactor Key.

*                  To reverse a conditional or replace a nested conditional with a guard clause, place the cursor on the "if" keyword and press the Refactor Key.


No other code simplification and refactoring tool is able to provide so much functionality with just one key. Refactor is the only refactoring and code simplification tool with one-key refactoring.

 

 

What's in Visual Basic 2005 for the Visual Basic 6.0 Developer

I admit that when I tried to create my first VB.NET application I wasn’t that comfortable, and when I tried to convert my VB 6.0 application in VB.NET, the upgrade wizard failed for even the simplest things, I always missed old VB, but now it seems that the world is changing with VB .NET 2005 read on in the words of Scott Swigart  the complete stuff is on http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/html/VB05forVB6.asp

 

I Haven't Needed .NET for Anything so Far...

The Microsoft Hype Machine has already started turning up the volume on Visual Studio 2005. The question is, if you work primarily in Visual Basic 6, you're happy with Visual Basic 6, and you've looked at .NET and not found anything you really need, should you even care about this new release of Visual Studio 2005? Considering that MSDN has been nice enough to host this article, you can probably guess the conclusion that I've reached. But bear with me, there are some great things coming for the Visual Basic 6 developer.

First of all, let's just admit that for many of us, Visual Basic .NET left something to be desired. If you think back to when Microsoft unleashed .NET on the world, the megaphone was blaring only two things: Web Service and C#. Well, many of us Visual Basic 6 developers, didn't need (or even want) Web Services. And, we weren't really interested in learning this new C# language when we already had a good language. After Web Services and C#, the other thing that Microsoft was blaring was ASP.NET. While many of us do some Web development, lots of Visual Basic 6 developers are primarily interested in desktop applications, so if .NET was all about Web Services, C#, and ASP.NET, then Microsoft should understand if many of us did not find anything in .NET that we couldn't live without.

Finally, let's just say that Visual Basic .NET wasn't 100 percent compatible with Visual Basic 6. This made it non-trivial to move a Visual Basic 6 application to .NET, assuming that I wanted to.

 

”   

Friday, December 02, 2005

Accessing database in a secured way from InfoPath ?

The real issue which exists here is, InfoPath xsn file is a combination of XML files with is finally nothing but something that is very readable, so even if you create a secured database, and in the connection string you provide the user name & password; its stored in the XML file...!!! fully readable ..so please don’t do it.. unless you really want to expose your username & password.

The only(easier) possible workaround(yes; workaround !)  is to use a web service which runs in the context of a specific user, give the permissions to this user on your database  and then you can create a InfoPath form with accesses the webservice ...but the point is . xsn file will still reveal the server name where the webservice is situated..so its upto you if you dont mind you can go ahead & do it..

The other way is use the .NET code behind use ADO.NET to access the data and updata the xml nodes in Infopath programmatically..its offcourse secure ..but you have to give full trust to the IP form in order to allow it to execute....moreover...if you need to do all this just make sure you really need InfoPath :) may be the tool that you really need is ASP.NET have a look at http://msdn.microsoft.com/library/en-us/odc_ip2003_ta/html/odc_IPInfoPathDecisionTree02.gif  if you are confused. Also have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2k3ta/html/Office2003OverviewDeveloperTechnologies.asp