Dodawanie plików do PST w Jython

Aspose.Email - Dodawanie plików do PST

Aby dodać plik do PST przy użyciu Aspose.Email Java for Jython, po prostu wywołaj moduł AddFileToPST. Tutaj możesz zobaczyć przykładowy kod.

Kod Jython

 from aspose-email import Settings

from com.aspose.email import PersonalStorage

from com.aspose.email import FileFormatVersion

from com.aspose.email import StandardIpmFolder

class AddFileToPST:

    def __init__(self):



        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddFileToPST/'



        personalStorage=PersonalStorage()

        fileFormatVersion=FileFormatVersion

        pst = personalStorage.create(dataDir + "AddFile1.pst", fileFormatVersion.Unicode)

        standardIpmFolder=StandardIpmFolder

        fi = pst.createPredefinedFolder("Inbox", standardIpmFolder.Inbox)

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

        pst.dispose()

        print "Added file to PST"





if __name__ == '__main__':        

    AddFileToPST()

Pobierz działający kod

Pobierz Adding Files to PST (Aspose.Email) z dowolnego z wymienionych poniżej serwisów kodowania społecznościowego: