VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 14

Chapter 14 - Creating an Active Document

( Contents )

Programmers can use Active Documents to provide a variety of new services previously unavailable. Some of these services are summarized as follows:
  • You can create applications that can execute within a container application such as Microsoft Internet Explorer or Microsoft Binder.

  • The Active Document server will execute locally and have all the code needed to carry out its operations.

  • Designing the GUI portion of Active Documents is easier than using HTML because of Visual Basic's WYSIWYG design environment.

  • Built-in support of hyperlinks that allow the document to navigate a browser container to a specific document or Web site.

  • Support for asynchronous data transfers.

The Active Document consists of two pieces: the Active Document (which contains the data) and the Active Document Server. The data in an Active Document cannot be viewed or edited without the Active Document Server present on the client machine. If the Active Document Server is not on the client, a different document server may view the Document contents if it can read the Document's data. This chapter covers the following topics:

  • Using a UserDocument object, which is the basis of an Active Document, just as the UserControl is the basis for an ActiveX control.

  • Understanding and implementing UserDocument lifetime events.

  • Using the necessary techniques to persist property values.

  • Understanding the relationship of an Active Document to various types of container applications, such as Internet Explorer or Office Binder, including the awareness of the container's ViewPort in the Active Document and the coexistence of container and document menus.

  • Implementing custom Active Document properties and methods.

  • Understanding asynchronous downloads of property information in the background while your document continues other processing.

  • Knowing when you can use Modeless Forms in an Active Document.

  • Writing code to navigate among container documents.

  • Testing your Active Document project at design time.

  • Compiling and distributing an Active Document including Internet distribution issues.

An Active Document application is a special type of ActiveX Component application that acts very much like a form. The Active Document, however, is unlike a form in that it integrates seamlessly into another special type of application known as an Active Document container.


  1. Overview and Definition of Active Documents

  2. Steps to Implementing an Active Document

  3. Setting Up the UserDocument
    Converting an Existing Project to an Active Document
    Creating an Active Document Project
    Choosing Between an Active Document EXE and an Active Document DLL

  4. Running Your Active Document in a Container Application
    Detecting the Type of Container With the TypeName Function and UserDocument.Parent

  5. Managing the Events in Your Active Document’s Lifetime
    Initialize Event
    InitProperties Event
    EnterFocus Event
    Show Event
    The ReadProperties Event and ReadProperty Method
    The WriteProperties Event and the WriteProperty Method
    ExitFocus Event
    Hide Event
    Terminate Event

  6. Managing Active Document Scrolling
    The Scrollbars Property and MinHeight and MinWidth Properties
    The HScrollSmallChange and VScrollSmallChange Properties
    The Scroll Event Procedure and the ContinuousScroll Property

  7. Managing The Active Document’s ViewPort
    The ViewPort Coordinate Properties
    SetViewPort Method

  8. Defining Your Active Document's Custom Members

  9. Data and Property Persistence in Active Documents
    Saving Information in the .vbd File
    Data Preservation Events and the Properties Bag

  10. Asynchronous Download of Information
    Starting the Download With the AsyncRead Method
    Stopping the Download With the CancelAsyncRead Method
    Reacting to the Download Completion With the AsyncReadComplete Event

  11. Defining Your Active Document’s Menus
    Design Considerations for Active Document Menus
    Negotiating With the Container’s Menus
    Merging Your Help Menu With the Container’s Help Menu

  12. Limitations of Modeless Forms in an Active Document Project

  13. Navigating Between Documents in the Container Application
    Using the Hyperlink Object With Internet-Aware Containers
    Navigating the Container App’s Object Model
    Writing an Application to Handle Different Containers’ Navigation Styles
    Creating an ActiveX Project With Multiple UserDocument Objects

  14. Testing Your Active Document in the VB Design Environment

  15. Compiling and Distributing Your Active Document

  16. Using Your Active Document on a Web Page


Get Started >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved