|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.moyosoft.connector.ms.outlook.Outlook
Provides access to the Outlook application. An Outlook object is the starting point for accessing Outlook, its folders and items.
The code using the Outlook class has to run on the computer where the Outlook application is installed. The default constructor connects to that Outlook application:
Outlook outlook = new Outlook();
Native resources used by the Outlook object should be disposed by calling the method dispose() of this class.
Usage example:
Outlook outlook = new Outlook();
System.out.println("Your Outlook version is: " + outlook.getOutlookVersion());
outlook.dispose();
Outlook()
,
dispose()
Constructor Summary | |
Outlook()
Default constructor. |
|
Outlook(java.lang.String profile,
java.lang.String password)
Creates the Outlook object and logs on with the specified profile. |
|
Outlook(java.lang.String profile,
java.lang.String password,
boolean showDialog,
boolean newSession)
Creates the Outlook object and logs on with the specified profile. |
Method Summary | |
void |
addStore(java.io.File storePstFile)
Opens the specified PST file in a new Outlook folder. |
void |
addStore(java.io.File storePstFile,
StoreType type)
Opens the specified PST file in a new Outlook folder. |
static Outlook |
createInstance(com.moyosoft.connector.com.ComManager comManager)
Creates the Outlook object and logs 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)
Creates the Outlook object and logs on with the specified profile. |
OutlookItem |
createItemFromTemplate(java.io.File templateFile)
Creates an OutlookItem object from the specified .msg file. |
OutlookItem |
createItemFromTemplate(java.io.File templateFile,
OutlookFolder destinationFolder)
Creates an OutlookItem object from the specified .msg file and places that item in the specified destination folder. |
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()
Returns the active (focused) Outlook Explorer window. |
Inspector |
getActiveInspector()
Returns the active (focused) Outlook Inspector window. |
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)
Returns the default folder for the specified folder type. |
OutlookFolderID |
getDefaultFolderId(FolderType pFolderType)
Deprecated. Use the getDefaultFolder(FolderType) method instead. |
static java.lang.String |
getDefaultProfileName()
Returns the user's default profile name as specified in the Windows registry HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile. |
ExplorersCollection |
getExplorers()
|
OutlookFolder |
getFolder(OutlookFolderID pFolderId)
Retrieve information about an 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. |
static java.lang.String[] |
getProfileNames()
Returns all the user's profiles listed in the Windows registry HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\. |
OutlookRecipient |
getRecipientFromID(java.lang.String entryID)
Returns the OutlookRecipient object for the specified ID. |
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()
Logs off |
void |
logon()
Logs on with the default profile or displays a profile selection dialog box. |
void |
logon(java.lang.String pProfile)
Logs on with the specified profile. |
void |
logon(java.lang.String pProfile,
java.lang.String pPassword,
boolean pShowDialog,
boolean pNewSession)
Logs on with the specified profile. |
OutlookFolder |
pickFolder()
|
void |
quitApplication()
|
void |
removeStore(OutlookFolder folder)
Removes the specified folder's store and closes the corresponding PST file. |
static void |
setLibraryPath(java.lang.String pFilePath)
Sets the path to the native DLL library file (moyocore.dll). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Outlook() throws com.moyosoft.connector.com.ComponentObjectModelException, LibraryNotFoundException
com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException
public Outlook(java.lang.String profile, java.lang.String password) throws com.moyosoft.connector.com.ComponentObjectModelException, LibraryNotFoundException
public Outlook(java.lang.String profile, java.lang.String password, boolean showDialog, boolean newSession) throws com.moyosoft.connector.com.ComponentObjectModelException, LibraryNotFoundException
Method Detail |
public static void setLibraryPath(java.lang.String pFilePath) throws com.moyosoft.connector.com.ComponentObjectModelException
If the library file is not in a location defined by the java.library.path
system
property, this method can be used to specify the exact location of the file.
Alternatively, the java.library.path
property can be defined when launching the Java application:
java -Djava.library.path=[Folder where the library file is] ...
This static method has to be called BEFORE creating an instance of the Outlook object.
Usage example:
Outlook.setLibraryPath("c:\\moyocore.dll");
Outlook outlook = new Outlook();
//...
outlook.dispose();
pFilePath
- the path to the native DLL file, including the filename (moyocore.dll)
com.moyosoft.connector.com.ComponentObjectModelException
- if the library is already loaded.public static Outlook createInstance(com.moyosoft.connector.com.ComManager comManager) throws com.moyosoft.connector.com.ComponentObjectModelException, LibraryNotFoundException
com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException
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
com.moyosoft.connector.com.ComponentObjectModelException
LibraryNotFoundException
public static java.lang.String getDefaultProfileName() throws LibraryNotFoundException, RegistryException
LibraryNotFoundException
RegistryException
public static java.lang.String[] getProfileNames() throws LibraryNotFoundException, RegistryException
LibraryNotFoundException
RegistryException
public void logon(java.lang.String pProfile, java.lang.String pPassword, boolean pShowDialog, boolean pNewSession) throws com.moyosoft.connector.com.ComponentObjectModelException
pProfile
- profile's namepPassword
- passwordpShowDialog
- pNewSession
- if true create a new session; otherwise use existing session if any
com.moyosoft.connector.com.ComponentObjectModelException
- if any error occurspublic void logon(java.lang.String pProfile) throws com.moyosoft.connector.com.ComponentObjectModelException
pProfile
- profile's name
com.moyosoft.connector.com.ComponentObjectModelException
- if any error occurspublic void logon() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any error occurspublic void logoff() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
public FoldersCollection getFolders() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if an COM error occurs.public java.util.List getAllFolders() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if an COM error occurs.public java.util.List getRootFolders() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if an COM error occurs.public OutlookFolder getFolder(OutlookFolderID pFolderId) throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookFolderID getDefaultFolderId(FolderType pFolderType) throws com.moyosoft.connector.com.ComponentObjectModelException
pFolderType
- folder type
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookFolder getDefaultFolder(FolderType pFolderType) throws com.moyosoft.connector.com.ComponentObjectModelException
pFolderType
- folder type
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookFolder getRootPersonalFolder()
public OutlookFolder getPersonalFolder(java.lang.String folderPath)
Example:
Outlook outlook = new Outlook();
OutlookFolder inbox = outlook.getPersonalFolder("Inbox");
outlook.dispose();
public OutlookFolder getFolder(java.lang.String folderPath) throws com.moyosoft.connector.com.ComponentObjectModelException
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
public OutlookItem getItem(OutlookFolderID pFolderId, OutlookItemID pItemId) throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookItem getItem(OutlookItemID pItemId) throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookRecipient getCurrentUser() throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookRecipient createRecipient(java.lang.String pRecipientName) throws com.moyosoft.connector.com.ComponentObjectModelException
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.
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public OutlookFolder getSharedDefaultFolder(OutlookRecipient pRecipient, FolderType pFolderType) throws com.moyosoft.connector.com.ComponentObjectModelException
com.moyosoft.connector.com.ComponentObjectModelException
- if any COM error occurs.public java.lang.String getOutlookVersion()
public Explorer getActiveExplorer()
public Inspector getActiveInspector()
public void quitApplication()
public ExplorersCollection getExplorers()
public InspectorsCollection getInspectors()
public OutlookWindow getActiveWindow()
public RemindersCollection getReminders()
public AddressListsCollection getAddressLists()
public OutlookFolder pickFolder()
public void addStore(java.io.File storePstFile)
storePstFile
- the PST file to be loadedremoveStore(OutlookFolder)
public void addStore(java.io.File storePstFile, StoreType type)
storePstFile
- the PST file to be loadedtype
- the type of the store: StoreType.DEFAULT, StoreType.UNICODE or StoreType.ANSIremoveStore(OutlookFolder)
public void removeStore(OutlookFolder folder)
addStore(File)
public boolean isOffline()
public void dial()
public void dial(OutlookContact contactToDial)
public AccountsCollection getAccounts()
public OutlookItem createItemFromTemplate(java.io.File templateFile)
public OutlookItem createItemFromTemplate(java.io.File templateFile, OutlookFolder destinationFolder)
public OutlookRecipient getRecipientFromID(java.lang.String entryID)
public com.moyosoft.connector.com.Dispatch getApplicationDispatch()
public com.moyosoft.connector.com.Dispatch getNamespaceDispatch()
public void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |