Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks,...

31
Hardcore Office Hardcore Office Development Development Don Kiely Don Kiely Software Technologist Software Technologist Third Sector Technologies Third Sector Technologies Fairbanks, Alaska Fairbanks, Alaska 4-306 4-306

Transcript of Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks,...

Page 1: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Hardcore Office Hardcore Office DevelopmentDevelopment

Don KielyDon KielySoftware TechnologistSoftware TechnologistThird Sector TechnologiesThird Sector TechnologiesFairbanks, AlaskaFairbanks, Alaska

4-3064-306

Page 2: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.
Page 3: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Me.AboutMe.About

Software Technologist for Third Sector Software Technologist for Third Sector Technologies in Fairbanks, AlaskaTechnologies in Fairbanks, Alaska

Develop software and Web applicationsDevelop software and Web applications www.infoinsights.comwww.infoinsights.com www.thethirdsector.comwww.thethirdsector.com

Business and technology consultingBusiness and technology consulting

Page 4: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

My Other JobsMy Other Jobs

AuthorAuthor Several books, including Several books, including VB Programmer’s VB Programmer’s

Guide to the Windows RegistryGuide to the Windows Registry Regular contributor to several Regular contributor to several

publications, including Informant’s publications, including Informant’s Microsoft Office & VBA Developer, VBPJ, Microsoft Office & VBA Developer, VBPJ, and Information Weekand Information Week

TrainingTraining VB, VBA, VI, and SQL Server instructor for VB, VBA, VI, and SQL Server instructor for

Application Developers Training CompanyApplication Developers Training Company

Page 5: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Who is. . . Who is. . .

Actively developing applications with Actively developing applications with Office as a primary component?Office as a primary component? Using Microsoft Office 2000 Developer Using Microsoft Office 2000 Developer

edition?edition? Primarily a VB developer?Primarily a VB developer?

Primarily developing with other tools?Primarily developing with other tools? Using the Workflow design tool in Using the Workflow design tool in

MOD?MOD?

Page 6: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

AgendaAgenda

Office as part of a distributed applicationOffice as part of a distributed application Windows DNAWindows DNA

Data-based applicationsData-based applications Logical architecture and physical deploymentLogical architecture and physical deployment Motherlode of objectsMotherlode of objects

Component-based developmentComponent-based development Data, data, everywhereData, data, everywhere Code location optionsCode location options Office on the WebOffice on the Web

Page 7: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Models Of Distributed AppsModels Of Distributed Apps

SneakerNetSneakerNet™™

Purest form of distributed computingPurest form of distributed computing Minimal infrastructure requirementsMinimal infrastructure requirements

SETI@HomeSETI@Home Distributed computingDistributed computing Download data and upload resultsDownload data and upload results

Classic client/serverClassic client/server Active connection required, can be stateless like the InternetActive connection required, can be stateless like the Internet

Three-tier, n-tierThree-tier, n-tier Internet/WebInternet/Web

As many others as you can think ofAs many others as you can think of

Page 8: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Windows DNA ArchitectureWindows DNA Architecture

No rigid boundaries between tiers and servicesNo rigid boundaries between tiers and services

Don’t limit your Don’t limit your thinking to using thinking to using Office here only!Office here only!

Page 9: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Windows DNA And OfficeWindows DNA And Office

Office’s place in n-tierOffice’s place in n-tier Presentation tierPresentation tier Business Logic tierBusiness Logic tier Data Services tierData Services tier Tools and system servicesTools and system services

Page 10: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Presentation Tier RolesPresentation Tier Roles

Gather information from the userGather information from the user Send information to the business Send information to the business

services for processingservices for processing Receive results of business Receive results of business

services processingservices processing Present results to the userPresent results to the user

Same, ol’ boring stuff.

Be creative!!

Page 11: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Business Logic Tier RolesBusiness Logic Tier Roles

Receive information from the Receive information from the presentation servicespresentation services

Interact with the data services to Interact with the data services to perform the business operations perform the business operations that the application was designed that the application was designed to automateto automate

e.g. Medical billing, Sales Force e.g. Medical billing, Sales Force Automation (SFA), order processing, Automation (SFA), order processing, income tax preparation, etc.income tax preparation, etc.

Send the processed results to the Send the processed results to the presentation servicespresentation services

Here’s where Office

Shines!!

Page 12: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Data Services Tier RolesData Services Tier Roles

Responsible for the storage, retrieval, Responsible for the storage, retrieval, maintenance, and integrity of datamaintenance, and integrity of data E.g., RDBMS, Mail Server, File SystemE.g., RDBMS, Mail Server, File System

Get used to ADOGet used to ADO Learn something about RDSLearn something about RDS Every app is a database appEvery app is a database app

Use Access? Maybe,

maybe not. But how integrate

data throughout

app?

Page 13: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Multiple Users, Multiple Multiple Users, Multiple Servers, And Multiple UlcersServers, And Multiple Ulcers Logical versus physicalLogical versus physical Where does Office fit in?Where does Office fit in? Several models. . . .Several models. . . .

Page 14: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Logical Versus PhysicalLogical Versus PhysicalSingle machineSingle machine

Data Services Tier

Business Logic Tier

Presentation TierPresentation Tier

ClientClient

Page 15: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Logical Versus PhysicalLogical Versus PhysicalClient-server machinesClient-server machines

Data Services Tier

Business Logic Tier

Presentation TierPresentation TierClientClient

ServerServer

Page 16: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Logical Versus PhysicalLogical Versus PhysicalClient-server alternativeClient-server alternative

Data Services Tier

Business Logic Tier

Presentation TierPresentation Tier

ClientClient

ServerServer

Page 17: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Logical Versus PhysicalLogical Versus PhysicalThree-tierThree-tier

Data Services Tier

Business Logic Tier

Presentation TierPresentation TierClientClient

Server BServer B

Server AServer A

Page 18: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Intra-Application Intra-Application Service CallsService Calls ArraysArrays Disconnected recordsetsDisconnected recordsets

Read/write recordsetsRead/write recordsets Read-only recordsets with action queriesRead-only recordsets with action queries

eXtensible Markup Language, XMLeXtensible Markup Language, XML Method parameters by referenceMethod parameters by reference Plenty of other options!Plenty of other options!

What makes sense for the application?What makes sense for the application? Different methods between different Different methods between different

tierstiers Different methods in each directionDifferent methods in each direction

Page 19: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Figuring Out Object ModelsFiguring Out Object Models

Hundreds of objects, thousands of featuresHundreds of objects, thousands of features Visual Basic for Applications object basicsVisual Basic for Applications object basics

ObjectsObjects Finding library and class namesFinding library and class names Objects in the registryObjects in the registry Object model diagramsObject model diagrams

Page 20: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

The Object BrowserThe Object Browser Expose all the details of the object libraries Expose all the details of the object libraries

currently accessible to currently accessible to your applicationyour application

Right-click to expose useful featuresRight-click to expose useful features Group membersGroup members Show hidden membersShow hidden members ReferencesReferences

Discovering the proper syntaxDiscovering the proper syntax Relating the model to the host applicationRelating the model to the host application

objXLWorksheet.Worksheets(1).Cells(1, 1).ValueobjXLWorksheet.Worksheets(1).Cells(1, 1).Value

Page 21: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Finding The Right ObjectFinding The Right Object Who has used Office Code Generator?Who has used Office Code Generator? Fixing up Macro Recorder codeFixing up Macro Recorder code

Use object variablesUse object variables Set a reference to object librarySet a reference to object library Remove hard-coded file namesRemove hard-coded file names Remove unnecessary parametersRemove unnecessary parameters Determine if host application is runningDetermine if host application is running

Other leads on objectsOther leads on objects Intellisense’s Auto List NameIntellisense’s Auto List Name Auto Quick InfoAuto Quick Info

Quirks of the Office object modelsQuirks of the Office object models

Page 22: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Code Location OptionsCode Location Options Issue of code reusabilityIssue of code reusability Locating code inside office applicationsLocating code inside office applications

Office documentsOffice documents Shared code across multiple Shared code across multiple

office applicationsoffice applications COM Add-insCOM Add-ins

Single Visual Basic for Applications Single Visual Basic for Applications project office applicationsproject office applications

Automating Office with external clientsAutomating Office with external clients Automating external applications Automating external applications

with Officewith Office In general: put the code as close to the In general: put the code as close to the

objects as you canobjects as you can

Page 23: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Where Store Data?Where Store Data? Internal to Office: documentsInternal to Office: documents

Access databasesAccess databases Excel spreadsheetsExcel spreadsheets OutlookOutlook®® for PIM data for PIM data Word for random textWord for random text

Internal to custom applicationInternal to custom application External data storesExternal data stores

DatabaseDatabase Windows registryWindows registry

Deciding on the right place to store dataDeciding on the right place to store data Format, normalization, multiple users, integrityFormat, normalization, multiple users, integrity

Import or link?Import or link?

Page 24: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

COM Add-InsCOM Add-Ins

Standard way of extending Office 2000Standard way of extending Office 2000 Across all host applicationsAcross all host applications Available both in user interface and Available both in user interface and

Visual Basic for Applications environmentVisual Basic for Applications environment Need to deal with various object modelsNeed to deal with various object models

Different models across Office 97Different models across Office 97 Create with any COM development toolCreate with any COM development tool

Page 25: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Building Add-In ObjectsBuilding Add-In Objects

Build with MOD or Visual BasicBuild with MOD or Visual Basic More flexibility with Visual BasicMore flexibility with Visual Basic

ActiveXActiveX®® designer designer Optional, but convenientOptional, but convenient Manages registry settings for youManages registry settings for you Include one for each hostInclude one for each host

Connect object used to load add-inConnect object used to load add-in

Page 26: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Putting Office On The WebPutting Office On The Web

FrontPageFrontPage®®, of course, of course Office Web componentsOffice Web components

Licensing issues!Licensing issues! Data access pagesData access pages Save as Web pageSave as Web page

Heavy use of XMLHeavy use of XML Office on the Web serverOffice on the Web server

Careful of licensing!Careful of licensing! Mostly the middle tier?Mostly the middle tier?

Page 27: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Questions?Questions?

See Appendix A for security issues in OfficeSee Appendix A for security issues in Office

Thanks for attending!Thanks for attending!

Please remember to fill out the Please remember to fill out the evaluation forms! How can I make this evaluation forms! How can I make this

a better presentation?a better presentation?

Don KielyDon [email protected]@computer.org

Third Sector TechnologiesThird Sector Technologies

Page 28: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Appendix A: Office SecurityAppendix A: Office SecurityThe Power & the ProblemThe Power & the Problem

Embedded VBA opens up a world of Embedded VBA opens up a world of application possibilitiesapplication possibilities While opening up a world of potential pain While opening up a world of potential pain

from macro virusesfrom macro viruses Anything that you can do from VBA you Anything that you can do from VBA you

can do from a VBA viruscan do from a VBA virus Delete filesDelete files Execute rogue ActiveX componentsExecute rogue ActiveX components Much, much moreMuch, much more

No such thing as a benign virusNo such thing as a benign virus

Page 29: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Security IssuesSecurity Issues

Protect intellectual propertyProtect intellectual property Block access to code you developBlock access to code you develop The embarrassing stuff, tooThe embarrassing stuff, too

Protect confidential informationProtect confidential information Block access to valuable information Block access to valuable information

contained within an Office documentcontained within an Office document Protect against malicious hackersProtect against malicious hackers

Block viruses from adding rogue codeBlock viruses from adding rogue code Uniquely identify origin of the code Uniquely identify origin of the code

(you)(you)

Page 30: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.

Office Protection RacketOffice Protection Racket

Document and template passwordsDocument and template passwords Excel and Word passwords, user login to VBA Excel and Word passwords, user login to VBA

applicationsapplications

Network securityNetwork security Built on Windows NT/2000 security for authentication Built on Windows NT/2000 security for authentication

and access to resourcesand access to resources

Third-party anti-virus softwareThird-party anti-virus software API link to Office documentsAPI link to Office documents

COM Add-inCOM Add-in Protects code from user manglingProtects code from user mangling

Lock VBA project to prevent editingLock VBA project to prevent editing Digital certificatesDigital certificates

Page 31: Hardcore Office Development Don Kiely Software Technologist Third Sector Technologies Fairbanks, Alaska 4-306.