📄 ch9.htm
字号:
<html>
<head>
<title>Chapter 9 -- Creating a MAPI Mailing List Manager with the OLE Messaging Library</title>
<meta NAME="GENERATOR" CONTENT="Microsoft FrontPage 3.0">
</head>
<body TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#CE2910">
<!-- Spidersoft WebZIP Ad Banner Insert -->
<!-- End of Spidersoft WebZIP Ad Banner Insert-->
<h1><font COLOR="#FF0000">Chapter 9</font></h1>
<h1><b><font SIZE="5" COLOR="#FF0000">Creating a MAPI Mailing List Manager with the OLE
Messaging Library</font></b> </h1>
<hr WIDTH="100%">
<h3 ALIGN="CENTER"><font SIZE="+2" COLOR="#000000">CONTENTS<a NAME="CONTENTS"></a> </font></h3>
<ul>
<li><a HREF="#Introduction">Introduction</a> <ul>
<li><a HREF="#LayingOuttheMLMForm">Laying Out the MLM Form</a> </li>
<li><a HREF="#CodingtheSupportRoutines">Coding the Support Routines</a> </li>
<li><a HREF="#CodingtheEditRoutines">Coding the Edit Routines</a> </li>
<li><a HREF="#CodingtheMAPIStartandMAPIEndroutine">Coding the MAPIStart and MAPIEnd routines</a>
</li>
<li><a HREF="#CodingtheSendMailRoutines">Coding the SendMail Routines</a> </li>
<li><a HREF="#CodingtheInboxRoutines">Coding the Inbox Routines</a> </li>
<li><a HREF="#AddingNewSubscribers">Adding New Subscribers</a> </li>
<li><a HREF="#DroppingSubscribers">Dropping Subscribers</a> </li>
<li><a HREF="#ListingArchives">Listing Archives</a> </li>
<li><a HREF="#SendingRequestedArchives">Sending Requested Archives</a> </li>
</ul>
</li>
<li><a HREF="#RunningtheMLMApplication">Running the MLM Application</a> <ul>
<li><a HREF="#TestingtheMLMApplication">Testing the MLM Application</a> </li>
</ul>
</li>
<li><a HREF="#Summary">Summary</a> </li>
</ul>
<hr>
<h2><a NAME="Introduction"><b><font SIZE="5" COLOR="#FF0000">Introduction</font></b></a> </h2>
<p>After reviewing the OLE Messaging Library objects in <a HREF="ch8.htm">Chapter 8</a>,
"The OLE Messaging Library," you're now ready to build a MAPI application for
Win95 and Visual Basic 4.0 that uses these objects. </p>
<p>The Mailing List Manager application lets users define and manage automated mailing
lists from the client desktop. Messages can be distributed within a single server or
across the Internet (depending on the available transports at the desktop). All access to
MAPI services will be performed through the OLE <tt><font FACE="Courier">Message</font></tt>
objects. </p>
<p>The key features of the Mailing List Manager (MLM) are:
<ul>
<li><font COLOR="#000000">Automatically scans incoming mail for MLM messages.</font> </li>
<li><font COLOR="#000000">Automatically adds and drops subscribers from the group.</font> </li>
<li><font COLOR="#000000">Automatically distributes messages based on current date.</font> </li>
<li><font COLOR="#000000">Allows subscribers to request copies of archived messages.</font> </li>
<li><font COLOR="#000000">Allows subscribers to request a default FAQ file.</font> </li>
<li><font COLOR="#000000">Most features are modifiable using control files.</font> </li>
</ul>
<p>The MLM application allows individuals to create a set of text files to be distributed
to a <br>
controlled list of users at specified times. This project has only one simple form and
several support routines. All application rules are stored in a set of ASCII control files
similar to INI/registry settings. These control files can be changed by the list manager
to determine how the mailing list operates and what features are available to subscribers.
</p>
<p>Once you complete this application, you'll be able to establish and manage one or more
one-way mailing lists from your own desktop. These mailing lists can be limited to your
current attached server or cross over any transport out onto the Internet (depending on
the transports installed on your desktop). </p>
<h3><a NAME="LayingOuttheMLMForm"><b>Laying Out the MLM Form</b></a> </h3>
<p>The MLM application has only one form. Since the primary purpose of the application is
to manage automated lists, there is very little needed in the way of a GUI interface. MLM
has a set of command buttons to initiate specific tasks and a single scrollable text box
to show progress as the application processes incoming and outgoing mail. </p>
<p>Start a new Visual Basic project and lay out the MLM form. Refer to Table 9.1 and
Figure 9.1 for details on the size and position of the controls on the form. </p>
<p><a HREF="f9-1.gif"><b>Figure 9.1 : </b><i>Laying out the MLM form.</i></a> <br>
</p>
<p align="center"><b>Table 9.1. MLM form controls.</b> </p>
<div align="center"><center>
<table BORDERCOLOR="#000000" BORDER="1" WIDTH="80%">
<tr>
<td WIDTH="161"><i><font SIZE="2">Control</font></i></td>
<td WIDTH="118"><i><font SIZE="2">Property</font></i> </td>
<td WIDTH="172"><i><font SIZE="2">Setting</font></i></td>
</tr>
<tr>
<td WIDTH="161">Form</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">frmMLM</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">5325</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Left</font></tt> </td>
<td WIDTH="172">1140</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Top</font></tt> </td>
<td WIDTH="172">1230</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Width</font></tt> </td>
<td WIDTH="172">7380</td>
</tr>
<tr>
<td WIDTH="161">Text Box</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">Text1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Font</font></tt> </td>
<td WIDTH="172">8pt MS Sans Serif, Bold</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">4635</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Left</font></tt> </td>
<td WIDTH="172">120</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">MultiLine</font></tt> </td>
<td WIDTH="172">-1 ' True</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Scrollbars</font></tt> </td>
<td WIDTH="172">2 ' Vertical</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Top</font></tt> </td>
<td WIDTH="172">120</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Width</font></tt> </td>
<td WIDTH="172">5115</td>
</tr>
<tr>
<td WIDTH="161">Command Button</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">Command1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Caption</font></tt> </td>
<td WIDTH="172">Edit &Controls</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Font</font></tt> </td>
<td WIDTH="172">8pt MS Sans Serif, Bold</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">450</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Index</font></tt> </td>
<td WIDTH="172">0</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Left</font></tt> </td>
<td WIDTH="172">5400</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Top</font></tt> </td>
<td WIDTH="172">120</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Width</font></tt> </td>
<td WIDTH="172">1800</td>
</tr>
<tr>
<td WIDTH="161">Command Button</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">Command1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Caption</font></tt> </td>
<td WIDTH="172">Edit &Subs</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Font</font></tt> </td>
<td WIDTH="172">8pt MS Sans Serif, Bold</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">450</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Index</font></tt> </td>
<td WIDTH="172">1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Left</font></tt> </td>
<td WIDTH="172">5400</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Top</font></tt> </td>
<td WIDTH="172">720</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Width</font></tt> </td>
<td WIDTH="172">1800</td>
</tr>
<tr>
<td WIDTH="161">Command Button</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">Command1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Caption</font></tt> </td>
<td WIDTH="172">Edit &Sked</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Font</font></tt> </td>
<td WIDTH="172">8pt MS Sans Serif, Bold</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">450</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Index</font></tt> </td>
<td WIDTH="172">2</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Left</font></tt> </td>
<td WIDTH="172">5400</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Top</font></tt> </td>
<td WIDTH="172">1320</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Width</font></tt> </td>
<td WIDTH="172">1800</td>
</tr>
<tr>
<td WIDTH="161">Command Button</td>
<td WIDTH="118"><tt><font FACE="Courier">Name</font></tt> </td>
<td WIDTH="172">Command1</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Caption</font></tt> </td>
<td WIDTH="172">Edit &Archive</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Font</font></tt> </td>
<td WIDTH="172">8pt MS Sans Serif, Bold</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Height</font></tt> </td>
<td WIDTH="172">450</td>
</tr>
<tr>
<td WIDTH="161"> </td>
<td WIDTH="118"><tt><font FACE="Courier">Index</font></tt> </td>
<td WIDTH="172">3</td>
</tr>
<tr>
<td WIDTH="161"> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -