none
ItemProperties Add method permanence RRS feed

  • Question

  • I am trying to add some user properties to some stored mailitems but after i add the properties and save the changes, then try to read the properties, they are not there. Does anybody know what is wrong?

    Code snippet:

    ======================================================================

        Set App = CreateObject("Outlook.Application")
        Set Fldr = App.Session.Folders.Item(3).Folders("Customers").Folders("NCR").Folders("Request Templates")
        Set msgTmp = Fldr.Items.Find("[Subject] = '" & LookupText & "'")
        
        Hr = Nz(txtHr, "10")
        Mn = Nz(txtMin, "00")
        Meridian = fraTime
        Tm = Hr & ":" & Mn & " " & Choose(Meridian, "AM", "PM")
        Subj2 = ReplaceEx(Nz(txtSubject), "','',"",""""", True)
        
        If Not HasProperty(msgTmp, "Description") Then Set PropDesc = msgTmp.ItemProperties.Add("Dexcription", olText)              
        PropDesc.Value = txtDescription

       msgTmp.Save

       Debug.Print msgTmp.ItemProperties("Description")        'or msgTmp.ItemProperties.Item("Description")

    ======================================================================

    I get error 91 when I try to read the new property

    Thursday, March 26, 2020 4:43 AM

Answers

  • Sorry, I had a misspelling somewhere. I think I got it straightened out.
    • Marked as answer by JnWayn Thursday, March 26, 2020 5:00 AM
    Thursday, March 26, 2020 4:59 AM

All replies