

The WebBrowser is a lot like the linking part of OLE (which, you ll recall, is short for object linking and embedding ). It also allows you to edit these objects and save them to their original files. The WebBrowser resembles Microsoft Internet Explorer and can display documents, spreadsheets, and HTML pages using the Navigate method. In many cases, we can use a WebBrowser ActiveX control to produce the same effect as a linked object within an OLE Container control. Let s work on replacing the OLE control and getting our upgraded application to show the Word document as it did in Visual Basic 6. 'UPGRADE_ISSUE: Ole method OLE1.CreateLink was not upgraded.

If you look at the upgrade report, you will find an entry saying that the control was not upgraded, and any code that manipulates the control will be marked with an upgrade warning similar to the following:

When we upgrade the project, the OLE control is replaced with a bright red label, indicating that the control could not be upgraded. OLE Container control with linked object in Visual Basic 6. Figure 15-1 shows a Visual Basic 6 form at design time, with an OLE Container control that has a link to a Word document stating, VB Rocks!! What happens to the control during an upgrade? Let s look at an example. NET does not support the OLE Container control. The most common usage is to display a picture. The OLE Container control can be data-bound to a field in a database using the DAO Data control or the RDO Remote Data control. To bind to an OLE object in a database typically to a picture. In the case of a linked document, any changes you make are immediately reflected in the document file, which can subsequently be loaded by Word. The difference between a linked object and an embedded object is that a linked object is linked to a file on disk instead of being compiled into the application. To create a control that contains a linked object, such as a Word document. If the user changes the object at run time, you can programmatically save the updated state to a file using the SaveToFile method and subsequently reload it using the ReadFromFile method. When your application is compiled, its state (the contents of the object) is compiled into your program. To create a control that contains an embedded object, such as a Microsoft Word document. In Visual Basic 6, the OLE Container control is commonly used in three ways. The OLE Container control was first introduced in Visual Basic 3 and is used to dynamically add objects to a form at run time.
