Tuesday, January 14, 2014

Read from OutLook

static void Classes_ReadFromOutlook(Args _args)
{
SysOutlookApplication sysOutlookApplication;
SysOutlook_NameSpace sysOutlookNameSpace;
SysOutlookMapiFolder sysOutlookMapiFolder;
SysOutlook_Folders sysOutlookFolders;
SysOutlook_Items collection;
COM message;
Notes messagebody;
;

#sysOutLookComDef
sysOutlookApplication = new sysOutlookApplication();
sysOutlookNameSpace = sysOutlookApplication.getNameSpace("MAPI");

sysOutlookNameSpace.logon();
sysOutlookFolders = sysOutlookNameSpace.Folders();
sysOutlookMapiFolder = sysOutlookNameSpace.getDefaultFolder(#OlDefaultFolders_olFolderInbox);

collection = sysOutlookMapiFolder.Items();
message = collection.GetFirst();

while (message)
{
info(message.subject());

message = collection.GetNext();
}
}

No comments: