LotusScript for Visual Basic Programmers - IBM Redbooks
LotusScript for Visual Basic Programmers - IBM Redbooks
LotusScript for Visual Basic Programmers - IBM Redbooks
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
In <strong>Visual</strong> <strong>Basic</strong> sending a message is equally easy, as a mail control is<br />
available that embodies much of the mail system’s features. The following<br />
<strong>Visual</strong> <strong>Basic</strong> code demonstrates a MAPI-based mail transfer. If you wish to<br />
handle cc:Mail or pass through a generic VIM layer, to move mail from a<br />
<strong>Visual</strong> <strong>Basic</strong> system to a VIM-based system, third-party controls are also<br />
available to do this. After dropping the mail control on your <strong>for</strong>m, enter<br />
this code behind the send button:<br />
Sub cmdSend_Click<br />
frmMain.MapiMess.Action = MESSAGE_COMPOSE<br />
frmMain.MapiMess.RecipDisplayName = Address$<br />
frmMain.MapiMess.Action = MESSAGE_RESOLVENAME<br />
if txtSubject = "" then<br />
else<br />
endif<br />
frmMain.MapiMess.MsgSubject = _<br />
"Here is a quick thought ..."<br />
frmMain.MapiMess.MsgSubject = txtSubject.text<br />
if txtMemo = "" then<br />
else<br />
frmMain.MapiMess.MsgNoteText = "Example Text"<br />
frmMain.MapiMess.MsgNoteText = txtMemo.text<br />
endif<br />
frmMain.MapiMess.Action = MESSAGE_SEND<br />
End Sub<br />
Code Sharing Concerns<br />
As far as the languages’ syntax itself, this is not a major area of concern.<br />
Much of the code written <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> should be able to move relatively<br />
easily into <strong>LotusScript</strong>.<br />
There are some things that might need to be pointed out.<br />
Close but Different<br />
Obviously, the code associated to user interface elements will need to be<br />
reviewed and most likely rewritten. The way controls are handled in Lotus<br />
Chapter 1: <strong>LotusScript</strong> and <strong>Visual</strong> <strong>Basic</strong>: A Comparison 27