com.moyosoft.connector.ms.outlook
Class Outlook

java.lang.Object
  |
  +--com.moyosoft.connector.ms.outlook.Outlook

public class Outlook
extends java.lang.Object


Constructor Summary
Outlook()
          Default constructor.
Outlook(java.lang.String profile, java.lang.String password)
          Create the Outlook object and log on with the specified profile.
Outlook(java.lang.String profile, java.lang.String password, boolean showDialog, boolean newSession)
          Create the Outlook object and log on with the specified profile.
 
Method Summary
 void addStore(java.io.File storePstFile)
           
 void addStore(java.io.File storePstFile, StoreType type)
           
static Outlook createInstance(com.moyosoft.connector.com.ComManager comManager)
          Create the Outlook object and log on with the default profile.
static Outlook createInstance(com.moyosoft.connector.com.ComManager comManager, java.lang.String profile, java.lang.String password, boolean showDialog, boolean newSession)
          Create the Outlook object and log on with the specified profile.
 OutlookItem createItemFromTemplate(java.io.File templateFile)
           
 OutlookItem createItemFromTemplate(java.io.File templateFile, OutlookFolder destinationFolder)
           
 OutlookRecipient createRecipient(java.lang.String pRecipientName)
          Create a recipient object.
 void dial()
           
 void dial(OutlookContact contactToDial)
           
 void dispose()
          Dispose the outlook library.
 AccountsCollection getAccounts()
          Returns the Outlook accounts collection.
 Explorer getActiveExplorer()
           
 Inspector getActiveInspector()
           
 OutlookWindow getActiveWindow()
           
 AddressListsCollection getAddressLists()
           
 java.util.List getAllFolders()
          Deprecated. Use the getFolders() method instead.
 com.moyosoft.connector.com.Dispatch getApplicationDispatch()
           
 OutlookRecipient getCurrentUser()
          Returns the currently logged-on user as an OutlookRecipient object
 OutlookFolder getDefaultFolder(FolderType pFolderType)
          Return the default folder for the specified folder type.
 OutlookFolderID getDefaultFolderId(FolderType pFolderType)
          Deprecated. Use the getDefaultFolder(FolderType) method instead.
 ExplorersCollection getExplorers()
           
 OutlookFolder getFolder(OutlookFolderID pFolderId)
          Retrieve information about a Outlook folder identified by the folder ID.
 OutlookFolder getFolder(java.lang.String folderPath)
          Returns a folder for the specified name or path.
 FoldersCollection getFolders()
          Retrieve information about Outlook folders.
 InspectorsCollection getInspectors()
           
 OutlookItem getItem(OutlookFolderID pFolderId, OutlookItemID pItemId)
          Retrieve information about an Outlook item identified by the specified item ID.
 OutlookItem getItem(OutlookItemID pItemId)
          Retrieve information about an Outlook item identified by the specified item ID.
 com.moyosoft.connector.com.Dispatch getNamespaceDispatch()
           
 java.lang.String getOutlookVersion()
           
 OutlookFolder getPersonalFolder(java.lang.String folderPath)
          Returns a sub-folder of the root "Personal folders" folder for the specified name or path.
 OutlookRecipient getRecipientFromID(java.lang.String entryID)
           
 RemindersCollection getReminders()
           
 java.util.List getRootFolders()
          Deprecated. Use the getFolders() method instead.
 OutlookFolder getRootPersonalFolder()
          Returns the root "Personal folders" folder.
 OutlookFolder getSharedDefaultFolder(OutlookRecipient pRecipient, FolderType pFolderType)
          Returns the specified default folder for the specified user.
 boolean isOffline()
           
 void logoff()
          Log off
 void logon()
          Log on with the default profile or displays a profile selection dialog box.
 void logon(java.lang.String pProfile)
          Log on with the specified profile.
 void logon(java.lang.String pProfile, java.lang.String pPassword, boolean pShowDialog, boolean pNewSession)
          Log on with the specified profile.
 OutlookFolder pickFolder()
           
 void quitApplication()
           
 void removeStore(OutlookFolder folder)
           
static void setLibraryPath(java.lang.String pFilePath)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Outlook

public Outlook()
        throws com.moyosoft.connector.com.ComponentObjectModelException,
               LibraryNotFoundException
Default constructor. Create the Outlook object and log on with the default profile.

Throws:
com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException

Outlook

public Outlook(java.lang.String profile,
               java.lang.String password)
        throws com.moyosoft.connector.com.ComponentObjectModelException,
               LibraryNotFoundException
Create the Outlook object and log on with the specified profile.


Outlook

public Outlook(java.lang.String profile,
               java.lang.String password,
               boolean showDialog,
               boolean newSession)
        throws com.moyosoft.connector.com.ComponentObjectModelException,
               LibraryNotFoundException
Create the Outlook object and log on with the specified profile.

Method Detail

setLibraryPath

public static void setLibraryPath(java.lang.String pFilePath)
                           throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException

createInstance

public static Outlook createInstance(com.moyosoft.connector.com.ComManager comManager)
                              throws com.moyosoft.connector.com.ComponentObjectModelException,
                                     LibraryNotFoundException
Create the Outlook object and log on with the default profile.

Throws:
com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException

createInstance

public static Outlook createInstance(com.moyosoft.connector.com.ComManager comManager,
                                     java.lang.String profile,
                                     java.lang.String password,
                                     boolean showDialog,
                                     boolean newSession)
                              throws com.moyosoft.connector.com.ComponentObjectModelException,
                                     LibraryNotFoundException
Create the Outlook object and log on with the specified profile.

com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException

logon

public void logon(java.lang.String pProfile,
                  java.lang.String pPassword,
                  boolean pShowDialog,
                  boolean pNewSession)
           throws com.moyosoft.connector.com.ComponentObjectModelException
Log on with the specified profile.

Parameters:
pProfile - profile's name
pPassword - password
pShowDialog -
pNewSession - if true create a new session; otherwise use existing session if any
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any error occurs

logon

public void logon(java.lang.String pProfile)
           throws com.moyosoft.connector.com.ComponentObjectModelException
Log on with the specified profile.

Parameters:
pProfile - profile's name
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any error occurs

logon

public void logon()
           throws com.moyosoft.connector.com.ComponentObjectModelException
Log on with the default profile or displays a profile selection dialog box.

Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any error occurs

logoff

public void logoff()
            throws com.moyosoft.connector.com.ComponentObjectModelException
Log off

Throws:
com.moyosoft.connector.com.ComponentObjectModelException

getFolders

public FoldersCollection getFolders()
                             throws com.moyosoft.connector.com.ComponentObjectModelException
Retrieve information about Outlook folders.

Returns:
The collection of OutlookFolder objects.
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if an COM error occurs.

getAllFolders

public java.util.List getAllFolders()
                             throws com.moyosoft.connector.com.ComponentObjectModelException
Deprecated. Use the getFolders() method instead.

Retrieve information about all Outlook folders.

Returns:
list of OutlookFolder objects.
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if an COM error occurs.

getRootFolders

public java.util.List getRootFolders()
                              throws com.moyosoft.connector.com.ComponentObjectModelException
Deprecated. Use the getFolders() method instead.

Retrieve information about root Outlook folders.

Returns:
list of OutlookFolder objects.
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if an COM error occurs.

getFolder

public OutlookFolder getFolder(OutlookFolderID pFolderId)
                        throws com.moyosoft.connector.com.ComponentObjectModelException
Retrieve information about a Outlook folder identified by the folder ID.

Returns:
OutlookFolder object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getDefaultFolderId

public OutlookFolderID getDefaultFolderId(FolderType pFolderType)
                                   throws com.moyosoft.connector.com.ComponentObjectModelException
Deprecated. Use the getDefaultFolder(FolderType) method instead.

Return the default folder's ID for the specified folder type.

Parameters:
pFolderType - folder type
Returns:
OutlookFolderID object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getDefaultFolder

public OutlookFolder getDefaultFolder(FolderType pFolderType)
                               throws com.moyosoft.connector.com.ComponentObjectModelException
Return the default folder for the specified folder type.

Parameters:
pFolderType - folder type
Returns:
OutlookFolder object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getRootPersonalFolder

public OutlookFolder getRootPersonalFolder()
Returns the root "Personal folders" folder.


getPersonalFolder

public OutlookFolder getPersonalFolder(java.lang.String folderPath)
Returns a sub-folder of the root "Personal folders" folder for the specified name or path. Accepted path separators are '\' or '/'.

Example:

Outlook outlook = new Outlook();
OutlookFolder inbox = outlook.getPersonalFolder("Inbox");
outlook.dispose();


getFolder

public OutlookFolder getFolder(java.lang.String folderPath)
                        throws com.moyosoft.connector.com.ComponentObjectModelException
Returns a folder for the specified name or path. Accepted path separators are '\' or '/'.

Example:

Outlook outlook = new Outlook();
OutlookFolder inbox = outlook.getFolder("Personal folders\\Inbox");
OutlookFolder myPublicFolder = outlook.getFolder("Public Folders/All Public Folders/My folder");
outlook.dispose();

com.moyosoft.connector.com.ComponentObjectModelException

getItem

public OutlookItem getItem(OutlookFolderID pFolderId,
                           OutlookItemID pItemId)
                    throws com.moyosoft.connector.com.ComponentObjectModelException
Retrieve information about an Outlook item identified by the specified item ID. This item is searched in the specified folder.

Returns:
OutlookItem object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getItem

public OutlookItem getItem(OutlookItemID pItemId)
                    throws com.moyosoft.connector.com.ComponentObjectModelException
Retrieve information about an Outlook item identified by the specified item ID.

Returns:
OutlookItem object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getCurrentUser

public OutlookRecipient getCurrentUser()
                                throws com.moyosoft.connector.com.ComponentObjectModelException
Returns the currently logged-on user as an OutlookRecipient object

Returns:
OutlookRecipient object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

createRecipient

public OutlookRecipient createRecipient(java.lang.String pRecipientName)
                                 throws com.moyosoft.connector.com.ComponentObjectModelException
Create a recipient object. This method is most commonly used to create a Recipient object for use with the getSharedDefaultFolder method, for example, to open a delegator's folder. It can also be used to verify a given name against an address book.

Parameters:
pRecipientName - The name of the recipient; it can be a string representing the display name, the alias, or the full SMTP e-mail address of the recipient.
Returns:
OutlookRecipient object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getSharedDefaultFolder

public OutlookFolder getSharedDefaultFolder(OutlookRecipient pRecipient,
                                            FolderType pFolderType)
                                     throws com.moyosoft.connector.com.ComponentObjectModelException
Returns the specified default folder for the specified user. This method is used in a delegation scenario, where one user has delegated access to another user for one or more of their default folders (for example, their shared Calendar folder).

Returns:
OutlookFolder object
Throws:
com.moyosoft.connector.com.ComponentObjectModelException - if any COM error occurs.

getOutlookVersion

public java.lang.String getOutlookVersion()

getActiveExplorer

public Explorer getActiveExplorer()

getActiveInspector

public Inspector getActiveInspector()

quitApplication

public void quitApplication()

getExplorers

public ExplorersCollection getExplorers()

getInspectors

public InspectorsCollection getInspectors()

getActiveWindow

public OutlookWindow getActiveWindow()

getReminders

public RemindersCollection getReminders()

getAddressLists

public AddressListsCollection getAddressLists()

pickFolder

public OutlookFolder pickFolder()

addStore

public void addStore(java.io.File storePstFile)

addStore

public void addStore(java.io.File storePstFile,
                     StoreType type)

removeStore

public void removeStore(OutlookFolder folder)

isOffline

public boolean isOffline()

dial

public void dial()

dial

public void dial(OutlookContact contactToDial)

getAccounts

public AccountsCollection getAccounts()
Returns the Outlook accounts collection. The accounts are only supported by Outlook 2007 or later; with other versions this method will throw an ComponentObjectModelException.
This method is only available in the Professional edition of Java Outlook Connector.


createItemFromTemplate

public OutlookItem createItemFromTemplate(java.io.File templateFile)

createItemFromTemplate

public OutlookItem createItemFromTemplate(java.io.File templateFile,
                                          OutlookFolder destinationFolder)

getRecipientFromID

public OutlookRecipient getRecipientFromID(java.lang.String entryID)

getApplicationDispatch

public com.moyosoft.connector.com.Dispatch getApplicationDispatch()

getNamespaceDispatch

public com.moyosoft.connector.com.Dispatch getNamespaceDispatch()

dispose

public void dispose()
Dispose the outlook library.