def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddMapiTaskToPST/'
        
        task = MapiTask("To Do", "Just click and type to add task", Date(), Date())
        task.setPercentComplete(20)
        task.setEstimatedEffort(2000)
        task.setActualEffort(20)

        mapiTaskHistory=MapiTaskHistory()

        task.setHistory(mapiTaskHistory.Assigned)
        task.setLastUpdate(Date())
        task.getUsers().setOwner("Darius")
        task.getUsers().setLastAssigner("Harkness")
        task.getUsers().setLastDelegate("Harkness")

        mapiTaskOwnership=MapiTaskOwnership()
        task.getUsers().setOwnership(mapiTaskOwnership.AssignersCopy)

        personalStorage=PersonalStorage()
        fileFormatVersion=FileFormatVersion
        pst = personalStorage.create(dataDir + "TaskPST.pst", fileFormatVersion.Unicode)
        standardIpmFolder=StandardIpmFolder
        task_folder = pst.createPredefinedFolder("Tasks",standardIpmFolder.Tasks)
        task_folder.addMapiMessageItem(task)

        print "Added MapiTask Successfully.".PHP_EOL
    def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddMapiJournalToPST/'
        
        d1 = Date()
        calendar=Calendar
        cl = calendar.getInstance()
        cl.setTime(d1)
        cl.add(calendar.HOUR, 1)
        d2 = cl.getTime()

        journal = MapiJournal("daily record", "called out in the dark", "Phone call", "Phone call")
        journal.setStartTime(d1)
        journal.setEndTime(d2)

        personalStorage=PersonalStorage()
        fileFormatVersion=FileFormatVersion
        pst = personalStorage.create(dataDir + "JournalPST.pst", fileFormatVersion.Unicode)

        standardIpmFolder=StandardIpmFolder

        journal_folder = pst.createPredefinedFolder("Journal", standardIpmFolder.Journal)
        journal_folder.addMapiMessageItem(journal)

        print "Added MapiJournal Successfully."
Ejemplo n.º 3
0
    def __init__(self):

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

        task = MapiTask("To Do", "Just click and type to add task", Date(),
                        Date())
        task.setPercentComplete(20)
        task.setEstimatedEffort(2000)
        task.setActualEffort(20)

        mapiTaskHistory = MapiTaskHistory()

        task.setHistory(mapiTaskHistory.Assigned)
        task.setLastUpdate(Date())
        task.getUsers().setOwner("Darius")
        task.getUsers().setLastAssigner("Harkness")
        task.getUsers().setLastDelegate("Harkness")

        mapiTaskOwnership = MapiTaskOwnership()
        task.getUsers().setOwnership(mapiTaskOwnership.AssignersCopy)

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion
        pst = personalStorage.create(dataDir + "TaskPST.pst",
                                     fileFormatVersion.Unicode)
        standardIpmFolder = StandardIpmFolder
        task_folder = pst.createPredefinedFolder("Tasks",
                                                 standardIpmFolder.Tasks)
        task_folder.addMapiMessageItem(task)

        print "Added MapiTask Successfully.".PHP_EOL
Ejemplo n.º 4
0
    def __init__(self):

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

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion
        pst = personalStorage.create(dataDir + "search.pst",
                                     fileFormatVersion.Unicode)

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

        mapiMessage = MapiMessage()
        mailMessage = MailMessage()
        fi.addMessage(
            mapiMessage.fromMailMessage(
                mailMessage.load(dataDir + "search.pst")))

        builder = MailQueryBuilder()
        builder.getFrom().contains("automated", true)

        query = builder.getQuery()
        coll = fi.getContents(query)

        print "Total Results:".coll.size()
    def __init__(self):

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

        d1 = Date()
        calendar = Calendar
        cl = calendar.getInstance()
        cl.setTime(d1)
        cl.add(calendar.HOUR, 1)
        d2 = cl.getTime()

        journal = MapiJournal("daily record", "called out in the dark",
                              "Phone call", "Phone call")
        journal.setStartTime(d1)
        journal.setEndTime(d2)

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion
        pst = personalStorage.create(dataDir + "JournalPST.pst",
                                     fileFormatVersion.Unicode)

        standardIpmFolder = StandardIpmFolder

        journal_folder = pst.createPredefinedFolder("Journal",
                                                    standardIpmFolder.Journal)
        journal_folder.addMapiMessageItem(journal)

        print "Added MapiJournal Successfully."
    def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/SearchMessagesAndFoldersInPST/'
        
        # Load the Outlook PST file
        personalStorage=PersonalStorage()
        pst = personalStorage.fromFile(dataDir + "sample1.pst")

        folder = pst.getRootFolder().getSubFolder("myInbox")
        builder = PersonalStorageQueryBuilder()

            # High importance messages
        mapiImportance=MapiImportance
        builder.getImportance().equals(mapiImportance.High)
        messages = folder.getContents(builder.getQuery())
        print "Messages with High Imp:" 
        print messages.size()

        #builder = PersonalStorageQueryBuilder()
        builder.getMessageClass().equals("IPM.Note")
        messages = folder.getContents(builder.getQuery())
        print "Messages with IPM.Note:" 
        print messages.size()

        # Messages with attachments AND high importance
        builder.getImportance().equals(mapiImportance.High)

        mapiMessageFlags=MapiMessageFlags

        builder.hasFlags(mapiMessageFlags.MSGFLAG_HASATTACH)
        messages = folder.getContents(builder.getQuery())
        print "Messages with atts: " 
        print messages.size()

        # Messages with size > 15 KB
        builder.getMessageSize().greater(15000)
        messages = folder.getContents(builder.getQuery())
        print "messags size > 15Kb:" 
        print messages.size()

        # Unread messages
        builder.hasNoFlags(mapiMessageFlags.MSGFLAG_READ)
        messages = folder.getContents(builder.getQuery())
        print "Unread:" 
        print messages.size()

        # Unread messages with attachments
        builder.hasNoFlags(mapiMessageFlags.MSGFLAG_READ)
        builder.hasFlags(mapiMessageFlags.MSGFLAG_HASATTACH)
        messages = folder.getContents(builder.getQuery())
        print "Unread msgs with atts: " 
        print messages.size()
Ejemplo n.º 7
0
    def __init__(self):

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

        # Load the Outlook PST file
        personalStorage = PersonalStorage()
        pst = personalStorage.fromFile(dataDir + "sample1.pst")

        folder = pst.getRootFolder().getSubFolder("myInbox")
        builder = PersonalStorageQueryBuilder()

        # High importance messages
        mapiImportance = MapiImportance
        builder.getImportance().equals(mapiImportance.High)
        messages = folder.getContents(builder.getQuery())
        print "Messages with High Imp:"
        print messages.size()

        #builder = PersonalStorageQueryBuilder()
        builder.getMessageClass().equals("IPM.Note")
        messages = folder.getContents(builder.getQuery())
        print "Messages with IPM.Note:"
        print messages.size()

        # Messages with attachments AND high importance
        builder.getImportance().equals(mapiImportance.High)

        mapiMessageFlags = MapiMessageFlags

        builder.hasFlags(mapiMessageFlags.MSGFLAG_HASATTACH)
        messages = folder.getContents(builder.getQuery())
        print "Messages with atts: "
        print messages.size()

        # Messages with size > 15 KB
        builder.getMessageSize().greater(15000)
        messages = folder.getContents(builder.getQuery())
        print "messags size > 15Kb:"
        print messages.size()

        # Unread messages
        builder.hasNoFlags(mapiMessageFlags.MSGFLAG_READ)
        messages = folder.getContents(builder.getQuery())
        print "Unread:"
        print messages.size()

        # Unread messages with attachments
        builder.hasNoFlags(mapiMessageFlags.MSGFLAG_READ)
        builder.hasFlags(mapiMessageFlags.MSGFLAG_HASATTACH)
        messages = folder.getContents(builder.getQuery())
        print "Unread msgs with atts: "
        print messages.size()
Ejemplo n.º 8
0
    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"
Ejemplo n.º 9
0
    def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/CreatePST/'
        
        # Create an instance of PersonalStorage
        personalStorage=PersonalStorage()
        pst = personalStorage.create(dataDir + "sample1.pst", 0)

        # Create a folder at root of pst
        pst.getRootFolder().addSubFolder("myInbox")

        # Add message to newly created folder
        mapi_message = MapiMessage()
        pst.getRootFolder().getSubFolder("myInbox").addMessage(mapi_message.fromFile(dataDir + "Message.msg"))

        print "Created PST successfully."
    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"
Ejemplo n.º 11
0
    def __init__(self):

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

        # Create an instance of PersonalStorage
        personalStorage = PersonalStorage()
        pst = personalStorage.create(dataDir + "sample1.pst", 0)

        # Create a folder at root of pst
        pst.getRootFolder().addSubFolder("myInbox")

        # Add message to newly created folder
        mapi_message = MapiMessage()
        pst.getRootFolder().getSubFolder("myInbox").addMessage(
            mapi_message.fromFile(dataDir + "Message.msg"))

        print "Created PST successfully."
Ejemplo n.º 12
0
    def __init__(self):

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

        mapiMessage = MapiMessage()
        mess = mapiMessage.fromFile(dataDir + "MapiNote.msg")

        # Note #1
        note1 = mess.toMapiMessageItem()
        note1.setSubject("Yellow color note")
        note1.setBody("This is a yellow color note")

        # Note #2
        note2 = mess.toMapiMessageItem()
        note2.setSubject("Pink color note")
        note2.setBody("This is a pink color note")

        noteColor = NoteColor

        note2.setColor(noteColor.Pink)
        noteColor

        # Note #3
        note3 = mess.toMapiMessageItem()
        note2.setSubject("Blue color note")
        note2.setBody("This is a blue color note")
        note2.setColor(noteColor.Blue)
        note3.setHeight(500)
        note3.setWidth(500)

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion()

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

        standardIpmFolder = StandardIpmFolder()

        notes_folder = pst.createPredefinedFolder("Notes",
                                                  standardIpmFolder.Notes)
        notes_folder.addMapiMessageItem(note1)
        notes_folder.addMapiMessageItem(note2)
        notes_folder.addMapiMessageItem(note3)

        print "Added MapiNote Successfully."
    def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddMapiNoteToPST/'
        
        mapiMessage=MapiMessage()
        mess = mapiMessage.fromFile(dataDir + "MapiNote.msg")

        # Note #1
        note1 = mess.toMapiMessageItem()
        note1.setSubject("Yellow color note")
        note1.setBody("This is a yellow color note")

        # Note #2
        note2 = mess.toMapiMessageItem()
        note2.setSubject("Pink color note")
        note2.setBody("This is a pink color note")

        noteColor=NoteColor

        note2.setColor(noteColor.Pink)
        noteColor
        

        # Note #3
        note3 = mess.toMapiMessageItem()
        note2.setSubject("Blue color note")
        note2.setBody("This is a blue color note")
        note2.setColor(noteColor.Blue)
        note3.setHeight(500)
        note3.setWidth(500)

        personalStorage=PersonalStorage()
        fileFormatVersion=FileFormatVersion()

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

        standardIpmFolder=StandardIpmFolder()

        notes_folder = pst.createPredefinedFolder("Notes", standardIpmFolder.Notes)
        notes_folder.addMapiMessageItem(note1)
        notes_folder.addMapiMessageItem(note2)
        notes_folder.addMapiMessageItem(note3)

        print "Added MapiNote Successfully."
    def __init__(self):
                        
        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/StringSearchInPST/'
        
        personalStorage=PersonalStorage()
        fileFormatVersion=FileFormatVersion
        pst = personalStorage.create(dataDir + "search.pst", fileFormatVersion.Unicode)

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

        mapiMessage=MapiMessage()
        mailMessage=MailMessage()
        fi.addMessage(mapiMessage.fromMailMessage(mailMessage.load(dataDir + "search.pst")))

        builder = MailQueryBuilder()
        builder.getFrom().contains("automated", true)

        query = builder.getQuery()
        coll = fi.getContents(query)

        print "Total Results:" . coll.size()
    def __init__(self):

        dataDir = Settings.dataDir + "ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddMapiContactToPST/"

        # Create an instance of MapiContact
        mapi_contact = MapiContact()

        # Contact #1
        contact1 = MapiContact("Sebastian Wright", "*****@*****.**")

        # Contact #2
        contact2 = MapiContact("Wichert Kroos", "*****@*****.**", "Grade A Investment")

        # Contact #3
        contact3 = MapiContact(
            "Christoffer van de Meeberg", "*****@*****.**", "Krauses Sofa Factory", "046-630-4614"
        )

        # Contact #4
        contact4 = MapiContact()
        contact4.setNameInfo(MapiContactNamePropertySet("Margaret", "J.", "Tolle"))

        mapiContactGender = MapiContactGender

        contact4.getPersonalInfo().setGender(mapiContactGender.Female)
        contact4.setProfessionalInfo(MapiContactProfessionalPropertySet("Adaptaz", "Recording engineer"))
        contact4.getPhysicalAddresses().getWorkAddress().setAddress("4 Darwinia Loop EIGHTY MILE BEACH WA 6725")
        contact4.getElectronicAddresses().setEmail1(
            MapiContactElectronicAddress("Hisen1988", "SMTP", "*****@*****.**")
        )
        contact4.getTelephones().setBusinessTelephoneNumber("(08)9080-1183")
        contact4.getTelephones().setMobileTelephoneNumber("(925)599-3355")

        # Contact #5
        contact5 = MapiContact()
        contact5.setNameInfo(MapiContactNamePropertySet("Matthew", "R.", "Wilcox"))
        contact5.getPersonalInfo().setGender(mapiContactGender.Male)
        contact5.setProfessionalInfo(MapiContactProfessionalPropertySet("Briazz", "Psychiatric aide"))
        contact5.getPhysicalAddresses().getWorkAddress().setAddress("Horner Strasse 12 4421 SAASS")
        contact5.getTelephones().setBusinessTelephoneNumber("0650 675 73 30")
        contact5.getTelephones().setHomeTelephoneNumber("(661)387-5382")

        # Contact #6
        contact6 = MapiContact()
        contact6.setNameInfo(MapiContactNamePropertySet("Bertha", "A.", "Buell"))
        contact6.setProfessionalInfo(MapiContactProfessionalPropertySet("Awthentikz", "Social work assistant"))
        contact6.getPersonalInfo().setPersonalHomePage("B2BTies.com")
        contact6.getPhysicalAddresses().getWorkAddress().setAddress("Im Astenfeld 59 8580 EDELSCHROTT")
        contact6.getElectronicAddresses().setEmail1(
            MapiContactElectronicAddress("Experwas", "SMTP", "*****@*****.**")
        )
        contact6.setTelephones(MapiContactTelephonePropertySet("06605045265"))

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion
        standardIpmFolder = StandardIpmFolder

        pst = personalStorage.create(dataDir + "MapiContactToPST1.pst", fileFormatVersion.Unicode)
        contactFolder = pst.createPredefinedFolder("Contacts", standardIpmFolder.Contacts)
        contactFolder.addMapiMessageItem(contact1)
        contactFolder.addMapiMessageItem(contact2)
        contactFolder.addMapiMessageItem(contact3)
        contactFolder.addMapiMessageItem(contact4)
        contactFolder.addMapiMessageItem(contact5)
        contactFolder.addMapiMessageItem(contact6)

        print "Added MapiContacts Successfully."
Ejemplo n.º 16
0
    def __init__(self):

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

        # Create an instance of MapiContact
        mapi_contact = MapiContact()

        # Contact #1
        contact1 = MapiContact("Sebastian Wright",
                               "*****@*****.**")

        # Contact #2
        contact2 = MapiContact("Wichert Kroos", "*****@*****.**",
                               "Grade A Investment")

        # Contact #3
        contact3 = MapiContact("Christoffer van de Meeberg",
                               "*****@*****.**",
                               "Krauses Sofa Factory", "046-630-4614")

        # Contact #4
        contact4 = MapiContact()
        contact4.setNameInfo(
            MapiContactNamePropertySet("Margaret", "J.", "Tolle"))

        mapiContactGender = MapiContactGender

        contact4.getPersonalInfo().setGender(mapiContactGender.Female)
        contact4.setProfessionalInfo(
            MapiContactProfessionalPropertySet("Adaptaz",
                                               "Recording engineer"))
        contact4.getPhysicalAddresses().getWorkAddress().setAddress(
            "4 Darwinia Loop EIGHTY MILE BEACH WA 6725")
        contact4.getElectronicAddresses().setEmail1(
            MapiContactElectronicAddress("Hisen1988", "SMTP",
                                         "*****@*****.**"))
        contact4.getTelephones().setBusinessTelephoneNumber("(08)9080-1183")
        contact4.getTelephones().setMobileTelephoneNumber("(925)599-3355")

        # Contact #5
        contact5 = MapiContact()
        contact5.setNameInfo(
            MapiContactNamePropertySet("Matthew", "R.", "Wilcox"))
        contact5.getPersonalInfo().setGender(mapiContactGender.Male)
        contact5.setProfessionalInfo(
            MapiContactProfessionalPropertySet("Briazz", "Psychiatric aide"))
        contact5.getPhysicalAddresses().getWorkAddress().setAddress(
            "Horner Strasse 12 4421 SAASS")
        contact5.getTelephones().setBusinessTelephoneNumber("0650 675 73 30")
        contact5.getTelephones().setHomeTelephoneNumber("(661)387-5382")

        # Contact #6
        contact6 = MapiContact()
        contact6.setNameInfo(
            MapiContactNamePropertySet("Bertha", "A.", "Buell"))
        contact6.setProfessionalInfo(
            MapiContactProfessionalPropertySet("Awthentikz",
                                               "Social work assistant"))
        contact6.getPersonalInfo().setPersonalHomePage("B2BTies.com")
        contact6.getPhysicalAddresses().getWorkAddress().setAddress(
            "Im Astenfeld 59 8580 EDELSCHROTT")
        contact6.getElectronicAddresses().setEmail1(
            MapiContactElectronicAddress("Experwas", "SMTP",
                                         "*****@*****.**"))
        contact6.setTelephones(MapiContactTelephonePropertySet("06605045265"))

        personalStorage = PersonalStorage()
        fileFormatVersion = FileFormatVersion
        standardIpmFolder = StandardIpmFolder

        pst = personalStorage.create(dataDir + "MapiContactToPST1.pst",
                                     fileFormatVersion.Unicode)
        contactFolder = pst.createPredefinedFolder("Contacts",
                                                   standardIpmFolder.Contacts)
        contactFolder.addMapiMessageItem(contact1)
        contactFolder.addMapiMessageItem(contact2)
        contactFolder.addMapiMessageItem(contact3)
        contactFolder.addMapiMessageItem(contact4)
        contactFolder.addMapiMessageItem(contact5)
        contactFolder.addMapiMessageItem(contact6)

        print "Added MapiContacts Successfully."