Sie sind auf Seite 1von 26

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRAPRADESH
Name : P. Sri Vidya
Designation : Lecturer
Branch : DCCP
Institute : Govt. Polytechnic for Women, Bheemili
Semester : VI Semester
Subject : Visual Basic II
Subject code : CCP- 603
Topic : Object Linking and Embedding(2/10)
Duration : 50 min.
Sub Topic : OLE in VB, OLE Applications
Teaching Aids : PPT
CCP-603.42 1
Recap

• Applications -Ms-Word, Excel etc.

• OLE.
• Meaning
• Purpose

CCP-603.42 2
Objectives

• On completion of this period, you would be


able to:

• Understand OLE in Visual Basic

• Know OLE terminology

• Differentiate between Linking and Embedding

• Understand OLE applications

CCP-603.42 3
Structure
• OLE in Visual Basic

• OLE terminology

• Differentiate between linking and Embedding OLE


Applications

CCP-603.42 4
Is VB procedure oriented or Object Oriented
language?
• VB is a Object Oriented Programming language.

CCP-603.42 5
Procedure oriented Vs. Object
oriented programming
• Procedure Oriented • Object Oriented

• Work with procedures • Work with self-


contained modules
called Objects

• User has to specify how • User has to specify


to do the task what is to be done

CCP-603.42 6
Objects

• The elements we use to build user interface.

• Manipulated using properties and methods.

• Example for VB objects

• Forms

• Controls

• Reports etc.

CCP-603.42 7
OLE object
• OLE object is an item that is exposed or made
available to other applications.

• A document containing more than a single type of


object is called a compound document.

CCP-603.42 8
What objects Word can expose to other
Applications ?
• A sentence

• A paragraph

• An entire document

CCP-603.42 9
What objects could Excel expose to other
applications?
• A cell

• A range of cells

• A chart

CCP-603.42 10
Methods to store objects of other OLE
application into our application
• Linking

• Embedding

CCP-603.42 11
Object Embedding

• A technique

• to insert

• a copy of an object
• from one application

• into another application.

CCP-603.42 12
Object Linking

• A technique

• to insert and link

• an object

• from one application

• into another application.

CCP-603.42 13
Differences between Linking& Embedding
• Linking • Embedding
• A linked component is created • A copy of the object is stored
with path to the original object as part of the OLE document
that contains it

• Documents containing linked • Embedding creates


objects are small in size. documents of larger size as it
stores copy of object.

• • Any changes made to the


Changes made to the contents contents of the original object
of the original object are seen are not seen in the container
in the container document. document unless the
embedded object is updated.

• Data in a linked object is • Data in the embedded object


saved automatically. is not saved automatically.

CCP-603.42 14
OLE Automation
• A method
• that allows
• to programmatically manipulate objects
• exposed by other application
• from within our Visual Basic applications.

CCP-603.42 15
Advantage of OLE automation
• With OLE automation
• along with objects we can access
• the functionality of the server application also.

• Ex:
• We can supply a table from Word to Excel and
get an Excel worksheet along with tool bars to
manipulate the data.

CCP-603.42 16
OLE Applications

• Server application

• Container application

CCP-603.42 17
Server application

• Applications
• that provide objects
• to other applications.

• Ex.
• Excel providing a worksheet to VB is Excel Server
Application

CCP-603.42 18
Client ( or Container) application
• Applications
• that accept or request
• objects from other applications.

• Ex.
• VB accepting and using a worksheet is a
Client application

CCP-603.42 19
Quiz
1.Self-contained modules are called

a) Classes

b) Objects

c) Component

d) OLE object

CCP-603.42 20
2. OLE is a way for applications to exchange both
data and functions

a) True

b) False

CCP-603.42 21
3. A document cannot contain more than a single
type of object

a) True

b) False

4. The embedded data are also linked to the container


document in linking method

CCP-603.42 22
5. We can programmatically manipulate objects
using OLE automation

a) True

b) False

CCP-603.42 23
Frequently asked questions

1. Differentiate between embedding and linking.

2. List the OLE applications.

CCP-603.42 24
ASSIGNMENT

1. What is OLE automation?

2. Differentiate between Procedure oriented and

Object oriented programming

3. Explain: 1. OLE Server application


2. OLE Container application

CCP-603.42 25
Summary
• VB is a highly successful Object oriented language
• Objects are the elements available in the application to build a
user interface.

• An application that supports OLE exposes objects to other


applications

• OLE object is an item that is exposed by an application.

• Server application is an application that provides objects

• Container application is an application that requests objects


CCP-603.42 26

Das könnte Ihnen auch gefallen