Visual Basic achievement of Office Assistant

Author:Anonymous    Updated:2008-10-28 12:06:35
Abstract: This paper describes the Visual Basic 6.0 development environment in their own applications on Microsoft's Active X control agents to carry out the general method of programming.

Keywords: Visual Basic 6.0, Active X, Agent

Introduction

I believe the majority of the programming staff of Microsoft's Office suite of office products will not be unfamiliar, but also will be noted that the strange appearance of the Office Assistant, when we need to seek help, press the F1 key when it will come down from heaven, We have to answer for when to complete the task and then will gradually disappear until the narrowing. This is an unusual than the rigid style of Windows with the help of many friendly. Users will feel the product of man-machine interface more cordial, if our application can achieve these features will undoubtedly make our program look of a high level. This article on the VB as an example to conduct a detailed introduction.

The design process to achieve

Microsoft Visual Basic 6.0 with its simple language, powerful features, elegant interface and Visual C + +, Delphi, C + + Builder, and so on the same language is widely used, especially for the Active X control aspects of the program is very simple and convenient, Therefore, this paper sample selection procedures as VB language.

Open Office directory, we find that there are a large number of executable files and DLL suffix, as well as some strange documents, and to the Office of such a large-scale software in general is to be divided into several modules, one or more functions related documents will be A separate document in order to save the form, as required in the implementation of the provisional implementation of the call, the Office assistant should be no exception, after a search and found that the suffix for acs for the file type that Microsoft Agent Character File, is a show that we need Microsoft Deputy document module.

VB with a new standard EXE file, according to the Ctrl + T hotkey to open \ "parts \" window, select from the Microsoft Agent Control 2.0, and add a new icon from the toolbar added to the form, as you can after the The use of other Active X controls to use it as its main attributes are Connected, Index, Left, RaiseRequestError, Tag, Top, and so on, are you choose the default value. When used first. Acs file loading, and then show the provisions movement can play, first of all, the definition of COM interfaces IAgentCtlCharacterEx and IAgentCtlRequest object:

Dim Dot0 As IAgentCtlCharacterEx
Dim AgentRequest As IagentCtlRequest

Set through their statements:

Set AgentRequest = Agent1.Characters.Load (\ "Dot0 \", \ "C: \ \. Logo.acs \")
Set Dot0 = Agent1.Characters.Character (\ "Dot0 \")

The remaining task is to call Dot0 object Shou function to display Play function, as well as their players, with the ultimate Hide to hide their function:

Dot0.Show (0)
Dot0.Play (\ "Alert \")
Dot0.Hide (0)

In this \ "Alert \" We are going to play action, there is a similar action, such as LookDown, Wave, and so are many, are as follows please list as needed in selection procedures, as appropriate, in appropriate actions:

 

Summary:

This article described methods for all of the Office suite of office. Acs documents are applicable, the name of the movement are in line, can be described by code, but third-party development acs documents should be in accordance with its document This article describe amending the code can take, or may not be expected to lead to the emergence of illegal error. This procedure in the Windows 2000 Professional + SP4, Microsoft Visual Basic 6.0 by the Chinese compiler version passed by the Microsoft Office 2000 for the provision of documents acs.
Previous:VB with the realization of multi-media API
Next:VB with the closure of the screen protection
User Reviews
Site Search
Recommended article
AD