VBPA - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

VBPA

Description:

Later, Microsoft introduced the name ActiveX and is currently using it parallelly with COM/OLE. ... ActiveX, COM/OLE and Automation ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 13
Provided by: adamtw
Category:
Tags: vbpa | activex

less

Transcript and Presenter's Notes

Title: VBPA


1
Chair of Business InformaticsProf. Dr. Karl
Kurbel
Visual BasicProgramming and Applications
1999/2000
2
ActiveX, COM/OLE and Automation
COM (Component Object Model) is the Microsoft
technology which enables program interoperability
Initially, this technology was referred as OLE
(Object Linking and Embedding). Later, Microsoft
introduced the name ActiveX and is currently
using it parallelly with COM/OLE.
3
ActiveX, COM/OLE and Automation
Automation is a feature of COM/OLE that enables
you to access and manipulate another
application's objects from outside that
application. Automation uses a Server/Client
model for communicationg between the
applications.
4
ActiveX, COM/OLE and Automation
A client executes an automation object which acts
as the server and performs some action, finally
giving the control back to the client.
5
MS Office Applications using COM/OLE
Microsoft Access provides database
service Microsoft Excel provides calculation and
financial presentation services Microsoft Word
provides word processing and desktop publishing
services Microsoft PowerPoint provides slideshow
services
6
Other Applications using COM/OLE
Graphic applications Microsoft PhotoDraw
2000 Visio 2000 Corel DRAW! 9.0 Adobe InDesign
1.0 Operating System Windows Scripting
Host (system-wide scripting, access to
files) Microsoft Internet Explorer (Web
browsing services)
7
How to Automate Applications?
CreateObject To start an application as
Automation server and create an instance of that
application object's class. Dim variable As
Object Set variable CreateObject("ApplicationNam
e.ObjectType") ... Set variable Nothing
8
How to Automate Applications?
GetObject To open an existing object rather than
create a new one. Dim variable As Object Set
variable GetObject("PathOfFile",
"ApplicationName.ObjectType")
9
Examples with CreateObject function
Accessing and manipulating Excel objects Dim
objExcel as Object Set objExcel
CreateObject("Excel.sheet") objExcel.Application.C
ells(4, 3).value "49" objExcel.Application.visib
le True objExcel.Application.Cells(4,
3).Font.Bold True objExcel.Application.Cells(7,
3).Formula _ "SUM(C1C5)" objExcel.Applicatio
n.Save "C\mysheet.xls" objExcel.application.Quit
10
Examples with CreateObject function
Accessing and manipulating Word objects Dim
objWord As Object Set objWord
CreateObject("Word.Basic") objWord.FileNewDefault
objWord.Insert "This is the first
statement." objWord.FileSaveAs "C\mydoc.doc" objW
ord.FileClose
11
OLE Container Control
It provides a bridge to windows applications The
application can be either linked or embedded
through the OLE container With linking, a link is
established to the data associated with the
application and only a snapshot of the data is
displayed. With embedding all the application's
data are actually contained in the OLE control
and no other application has access to the data.
12
Chair of Business InformaticsProf. Dr. Karl
Kurbel
Visual BasicProgramming and Applications
1999/2000
Write a Comment
User Comments (0)
About PowerShow.com