TechNet Event Session

Download Report

Transcript TechNet Event Session

Insights and Answers for IT Professionals
「Microsoft® Visio 2000 視覺化管理應用」
Developing Application
Solutions using
Visio 2000
Shawn Tng
Regional Technical Manager
Microsoft Asia
Agenda

Visio 2000 Structure





Integration with BackOffice




Windows 2000 Active Directory
Exchange Server 2000
SQL Server 2000
Demos


User Environment Basics
Visio Stencil Basics
Visio VBA
Connections To Data
Learning Objectives
Conclusion
Visio Working Environment Basics

Visio SmartShapes

Stencils

Drawing Page

Tools (and Wizards)

Hyperlinking

Layering Objects

ShapeSheet

manipulating shapes behavior and properties

parametric programming
Visio Stencil Basics

Visio Stencil is a collection of master
shapes

Stencils are editable, ie., master shapes in a
stencil can be added, modified or removed

Master shapes in a stencil can be linked to a
database

Master vs. Shape Instance

To create new stencil

File>Stencils>New Stencil
Visio 2000 VBA (Visual Basic
for Applications)

Current version: 6.0

Each Visio drawing and stencil document
includes its own VBA Project

Includes MSForms, ActiveX controls,
Automation … capabilities like all other
Office Applications products

Visio VBA can call out to the services of
other Automation servers => dump drawing
data to Access, create reports in Excel …
Connections To Data

Many Visio solution scenarios involve using
or producing external data, such as
business data from SQL database

Database Wizard


sets up a connection with an ODBC database

allows one to specify how table rows and fields
correspond to Visio shapes and cells
Alternatively, one can use ADO/DAO to
access databases in VBA environment
Integration with Windows 2000
Active Directory

Visio can read and store Active Directory
Service information in a Visio document

AD information can be written-out via LDAP

In VBA, include the Active DS object library
references to access AD data, such as:

Active DS Type Library

Active DS IIS Extension Dll

Active DS IIS Namespace Provider

IADs Tools

…
Integration with Exchange 2000


To access objects in VBA, include
appropriate Exchange 2000 object
libraries. Example:

Microsoft CDO For Exchange 2000 Library

MS CDO For Exchange Mgt Lib

MS Exchange Conference Administration
Type Lib

Microsoft Exchange IM Client 1.0 Type
Library (found in SDK file MSIMHost.exe)

…
Functions/Methods are referenced via
standard calling procedure
Integration with Exchange 2000
Public Sub GetIM()
Dim Msgrhost As MSIMHost
Dim MsgrSVC As MSIMService
Dim objIMContact As IIMContact
'Create the IM class
Set Msgrhost = CreateObject("MSExchangeIM.MSIMHost")
'Branch off of the IM Host class
Set MsgrSVC = Msgrhost.CreateContext("Default", 0)
MsgrSVC.Logon LogonName
Set objIMContact = MsgrSVC.CreateContact(LogonName)
Status.Text = GetState(objIMContact.state)
Set Msgrhost = Nothing
Set MsgrSVC = Nothing
End Sub
Integration with SQL Server 2000

SQL data can be connected via including
such appropriate object libraries like:

Microsoft DAO 3.51 Object Library

Microsoft ActiveX Data Objects 2.5 Library

Microsoft XML, ver2.0

Microsoft SQL Distribution Control Library 7.0

OLAP Add-In Manager

Microsoft Data Source Interfaces

Microsoft Report Designer v6.0

…
Integration with SQL Server 2000
Private Sub Document_RunModeEntered(ByVal doc As Visio.IVDocument)
'Make sure the ODBC database "Candy Equipment.mdb" is created or updated.
Dim sDBSourceName As String, sDBFileName As String, sDBDriver As String
sDBSourceName = "Cand-E-Quip"
'Note: put the database in the same directory as the Visio file.
'Then the location of the DB will be automatically built by
'appending the ThisDocument.Path property.
sDBFileName = ThisDocument.Path & "Candy Equipment.mdb"
sDBDriver = "Microsoft Access Driver (*.mdb)"
Call SetODBCDatasource(sDBSourceName, sDBFileName, sDBDriver)
End Sub
Conclusion

Combining Visio ShapeSheet and VBA
provide a powerful development platform to
build solutions

Referencing the various Object Libraries
enable us integrate Visio with W2K,
Exchange2K and other Office Applications

The Microsoft Office Application
development platform is extensible, robust
and interoperable
Additional Information …

http://www.microsoft.com/taiwan/products/
office/visio

http://msdn.microsoft.com/visio

http://www.microsoft.com/office/visio

Microsoft TechNet Resources

http://www.microsoft.com/technet/visio

http://www.microsoft.com/taiwan/technet

TechNet and TechNet Plus CD