Moyosoft Products | Services | Download | Contact us    
Java Outlook Connector
Products  >  Java Outlook Connector  >  API Reference    
API Reference
   
Overview  |  
Classic JavaDoc

Outlook.createItemFromTemplate

public OutlookItem createItemFromTemplate(java.io.File templateFile)

Creates an OutlookItem object from the specified .msg file.

public 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.

Community comments


Open an .msg file
Vote up  |  Vote down
        Outlook outlook = new Outlook();
        
        try
        {
            OutlookItem item = outlook.createItemFromTemplate(new File("test.msg"));
            
            if(item != null)
            {
                if(item.getType().isMail())
                {
                    OutlookMail mail = (OutlookMail) item;
                    String mailBody = mail.getBody();
                }

                item.display();
            }
        }
        finally
        {
            outlook.dispose();
        }


Powered by JavaDocPlus