Vous êtes sur la page 1sur 16

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
• Name : P.Sri Vidya
• Designation : Lecturer
• Branch : DCCP
• Institute : Govt. Polytechnic for Women, Bheemili
• Year/Semester : VI Semester
• Subject : Visual Basic - II
• Subject Code : CCP-603
• Topic : Object Linking & Embedding
• Duration : 50 Mts
• Sub Topic : Know the relation of Excel Worksheet and
• MS-Word to OLE
• Teaching Aids : PPT, Animation & Visuals
CCP603.50 1
Objectives

On Completion of this period, you would be


able to know..
• Know the relation of Excel Worksheet and Ms-Word to
OLE

• OLE Automation

• Examples on relation of Excel Worksheet and Ms-Word


to OLE

CCP603.50 2
Is there any relation among VB OLE, Ms-Excel
worksheet and Ms-Word?

Yes,

(Discussion with students on OLE server and other OLE


related words)

CCP603.50 3
Let us recall some OLE words..

OLE (short for Object linking and


embedding) refers to the process of inserting
linked and embedded objects in one application
that is created by another application

CCP603.50 4
Let us recall some OLE words..
• OLE Server Application:

• Exposes the objects that Visual Basic needs

Ex. When your application must edit a document


created by a server application, it contacts the
server application that will be used to edit the
document

CCP603.50 5
Let us recall some OLE words..

• OLE Automation:

• Allows to programmatically manipulate objects


exposed by another application from within the
Visual Basic applications

CCP603.50 6
OLE Automation..

• By using OLE Automation, we can control source


document from within VB application

• Applications that support OLE Automation expose


their objects to other application.

CCP603.50 7
OLE Automation..

• Ex. An Excel worksheet application may expose a


worksheet, chart, cell, or range of cells all as different
types of objects

• Ex. A Ms-Word processor might expose objects such


as application, document, paragraph, sentence,
bookmark or selection

CCP603.50 8
OLE Automation..

• When an application supports OLE Automation, the


objects it exposes can be accessed by Visual Basic

• Visual Basic can access both the objects of an OLE


server application and use the functionality of the
server application

CCP603.50 9
Accessing Excel and Ms-Word

• To be able to access OLE Automation


servers like Ms-Excel and Ms-Word from
within our VB application:

• Add the appropriate reference to the project


through References dialog box

• (Project  References)

CCP603.50 10
Accessing Excel and Ms-Word contd..

• To reference Excel, add the entry “Microsoft Excel


12.0 Library”

• To reference Word, add the entry “Microsoft Word


12.0 Library”

CCP603.50 11
OLE Automation Functions..

• CreateObject creates new object of a specified type

• GetObject retrieves an object from a file

CCP603.50 12
Summary…

• We discussed about…

• Know the relation of Excel Worksheet and Ms-


Word to OLE

• OLE Automation

• Examples on relation of Excel Worksheet and Ms-


Word to OLE

CCP603.50 13
Quiz

2. OLE Server application exposes the Objects that


visual Basic contacts – (True/False)

Ans: True

2. When an application supports OLE Automation, the


objects it exposes can be ___________________
by Visual Basic
Ans:. Accessed

CCP603.50 14
Frequently Asked Questions…

 Explain the relation of Excel Worksheet and Ms-


Word to OLE.

 Explain OLE Automation

CCP603.50 15
ASSIGNMENT

1. Give an example on relation of Excel


worksheet and Ms-Word to OLE

CCP603.50 16

Vous aimerez peut-être aussi