Module: Asposeemailjava::AddFileToPST

Defined in:
lib/asposeemailjava/Outlook/addfiletopst.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/asposeemailjava/Outlook/addfiletopst.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

    pst = Rjb::import('com.aspose.email.PersonalStorage').create(data_dir + "AddFile.pst", Rjb::import('com.aspose.email.FileFormatVersion').Unicode)

    fi = pst.createPredefinedFolder("Inbox", Rjb::import('com.aspose.email.StandardIpmFolder').Inbox)

    fi.addFile(data_dir + "Report.xlsx", "IPM.Document.Excel.Sheet.8")

    pst.dispose()

    puts "Added file to PST"
end