CDO object set of Exchange Server (1)

Source: Internet
Author: User

I. Description of CDO object set

CDO object set is a reliable API for applications to establish collaboration. ADO can be used to access the WEB storage system, but it lacks the most basic functions of collaborative jobs, while CDO can handle general applications and advanced workflow application solutions, CDO can even provide our ability to manage exchange and communicate with windows 2000 AD.

CDO: collaboration data objects is a technology that can be used to establish a wide range of collaborative job applications, such: applications that receive email, calendar, contact management, workflow, and exchange management.

CDO is not encapsulated into a separate object module. Instead, it contains three different object modules, each of which has its own specific purpose. These object modules can be used simultaneously or independently.

DLL file information of the three object modules:

Cdo for exchange 2000 server cdo. DLL

Cdo for exchange management cdoexm. DLL

Cdo workflow for exchange cdowf. DLL

Ii. basic functions of the three object modules

 1. CDO for exchange 2000 server

The most common CDO object module, which includes some of the most common core components and interfaces in collaborative operation applications. You can also use this object module to create and set folders in the web storage system. The top cdo objects are often used to create the following solutions:

Folder: (folder) the container in the mailbox or public storage area.

Personnel: (person) the contact type information in the WEB storage system folder, or the user or contact object in the AD.

Email: (message) email

Appointment: (appointment) scheduled appointment or meeting

Calendar information (calendar): (calendar message) Meeting invitation

Recipient: (addressee) email recipient in any form or recipient invited by the meeting

Attendees: (attendee) persons included in appointments or meetings

All objects at the top layer have two important interfaces)

Iconfiguration: defines the behavior modules that can be applied to multiple objects,

Idatasource: Each CDO object exposes the Idatasource interface to manage, store, and store data.

2. CDO for exchange management objects

This object module is used to establish and manage the categories and interfaces of the exchange mailbox and exchange server components. It is often used to compile program code for managing exchange recipients and email boxes. The object used is:

IMailRecipient: Specifies how to send and manage emails to users. This object can also enable contacts and folders to receive emails without requiring a mailbox.

IMailboxStore: Specifies how to create, move, and delete an exchange mailbox, and how to manage the attributes that can be managed by recipients who can use the mailbox. If you develop a WEB-based server management tool, this object module allows you to manage the server objects as a whole. The top objects available for these conditions are:

ExchangeServer: manages the exchange2000 server and Returns basic information, such as the server type and version.

FolderTree: manages the folder tree structure in the service, including any copies.

StorageGroup: Manages storage groups for organizing mailbox storage areas and public storage areas.

MailboxStoreDB: You can use this object to manage the mailbox storage area of a single user to connect, move, or interrupt the mailbox storage area, and return basic information about the database in the storage area.

PublicStoreDB: creates, manages, and deletes a public storage area, and Returns basic information about the database in the storage area.

 3. CDO Workflow for Exchange

This object module is composed of the categories and interfaces used to establish and execute workflows and route applications. There are two ways to create a workflow application:

Method 1: Use Workflow designer for Microsoft Exchange 2000 Server

Method 2: Use a self-built workflow event process and event acceptance method.

Using the former, we do not need most WorkFlow objects when using WorkFlow Designer. These objects are used only when writing scripts that respond to various WorkFlow actions, the objects most likely to be used in our Script are as follows:

IWorkflowSession: Provides the execution period (run-time) communication between the workflow engine, Action Script, and the processed workflow project (ProcessInstance.

IworkflowMessage: Create a notification email to be sent to the recipient during workflow processing.

AuditTrailEventLog: Creates a project (entries) related to workflow event dynamics in the application log ).

If Workflow Designer cannot provide the functions to be designed, you need to set up event acceptance. If you set up event acceptance, you need to be familiar with the following objects:

ProcessDefinition: defines the logic in a workflow, including the status and action.

ProcessInstance: control, record, and monitor the status of individual workflow items that move between workflow processing.

Iii. Getting started with CDO

1. Create an object by category

CDO is composed of multiple COM categories and serves as the basis for creating new objects. when an object is created, these categories determine the preset functions of the object standard. For example, the message category of CDO is used to define a new Message object. Each Message object has the same standard function, allowing the object to be transmitted and accepted.

Example of using VB to create a Message object:

Dim msg as cdo. message

Set msg = new cdo. message

Use vbbench to create a message object:

Dim msg

Set msg = server. createobject ("cdo. message ")

In this way, we can access the attributes and methods in the preset interfaces of this category, as well as other interfaces exposed by this category.

After using the object variable, the memory occupied by the object variable should be released: set msg = nothing

2. Use Interfaces)

The interface defines a set of attributes and Methods encapsulated together.

A category usually has multiple interfaces associated with it, including a default interface, which has a predefined category function. The default Interface is similar to the name presented by this object. It only has an I letter before the object name, indicating that this interface is relative to the class object, for example, the person category has an IPerson interface for managing all attributes and methods, which is especially used to define and manage contact type information. This preset interface is made public directly by the object to which it belongs, that is, we can call attributes and methods directly by the object. We can directly call the e-mail attribute of the Person object. The program code is as follows:

Dim prs as cdo. person

Set prs = new cdo. person

Prs. email = someone@domain.com

In addition to the default interfaces, most categories use at least one interface, and these preset interfaces are also used by other categories. The interface can be used to access its attributes and methods, which can be easily implemented by calling relevant attributes. For example, the Idatasource interface is accessed through Datasource. The Code is as follows: (VB)

Dim dsrc as Idatasource

Set dsrc = prs. datasource

Some interfaces do not have relevant attributes for reference. In this case, different measures are taken. If VB is used, an object variable is first declared as an appropriate interface, then, the interface object variables are directed to the interface exposed by the object to automatically complete the action of the reference interface, such as the CDOEXM IMailRecipient interface.

VB: dim container as cdo. folder

Dim rcp as cdoexm. imailrecipient

Set rcp = Signature

Vbscript cannot pre-set the data type for variables. You must use the getinterface method to access the interface. Almost every CDO object discloses the GetInterface method used to access the interface. An example is as follows:

Set rcp = response. getinterface ("imailrecipient ")


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.