my $Outlook = Win32::OLE->new('Outlook.Application', 'Quit');<BR>
my $ol = Win32::OLE::Const->Load($Outlook);<BR>
<BR>
my $namespace = $Outlook->GetNamespace("MAPI");<BR>
my $Folder = $namespace->GetDefaultFolder(olFolderInbox);<BR>
my $NewFolder = $Folder->Folders->Add("Test1");</CODE></P>
</BLOCKQUOTE>
</A><A name="use_ado">
<HR>
<H1>How do I use ADO?</H1>
<P>In order to use ActiveX Data Objects (ADO) you can just</P>
<BLOCKQUOTE>
<P><CODE>use strict;<BR>
use Win32::OLE;<BR>
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';<BR>
my $Conn = Win32::OLE->new('ADODB.Connection'); # creates a connection object<BR>
my $RS = Win32::OLE->new('ADODB.Recordset'); # creates a recordset
object<BR>
$Conn->Open('DBname'); #
opens the database connection<BR>
<BR>
my $Fields = ['Id', 'Name', 'Phone'];<BR>
my $Values = [1, 'Joe Doe', '555-1234'];<BR>
$RS->AddNew($Fields,
$Values); #
adds a record<BR>
<BR>
print "This didn't go well: ", Win32::OLE->LastError(), "\n";<BR>
if (Win32::OLE->LastError());<BR>
<BR>
$RS->Close;<BR>
$Conn->Close;</CODE></P>
</BLOCKQUOTE>
<P>To get further than this you should have a look at the ADO FAQ at </A><A href="http://www.fastnetltd.ndirect.co.uk/Perl/perl-win32-database.html">http://www.fastnetltd.ndirect.co.uk/Perl/perl-win32-database.html</A>
or Jan Dubois article in TPJ#10 (visit The Perl Journal at <A href="http://.tpj.com/">http://tpj.com/</A>).</P>
<A name="use_notes">
<HR>
<H1>How do I use Lotus Notes?</H1>
<P>Lotus Notes can be accessed through OLE, for example like this:</P>
<BLOCKQUOTE>
<P><CODE>use strict;<BR>
use Win32::OLE;<BR>
my $Notes = Win32::OLE->new('Notes.NotesSession')<BR>
or die "Cannot start Lotus Notes Session object.\n";<BR>
my ($Version) = ($Notes->{NotesVersion} =~ /\s*(.*\S)\s*$/);<BR>
print "The current user is $Notes->{UserName}.\n";<BR>
print "Running Notes \"$Version\" on \"$Notes->{Platform}\".\n";<BR>
my $Database = $Notes->GetDatabase('', 'help4.nsf');<BR>
my $AllDocuments = $Database->AllDocuments;<BR>
my $Count = $AllDocuments->Count;<BR>
print "There are $Count documents in the database.\n";<BR>