none
runtime error 91 or 5 on read/Add a item.UserProperties in Outlook RRS feed

  • Question

  • I use Windows 10  client Outlook 2007 in a domain ( server SBS 2003 with Exchange 2003 ). 

    When i read a item.userproperties from Outlook VBA in a Public Folder ( messageclass= IPM.Document.Excel.Sheet.8 or  IPM.Document.Excel.SheetMacroEnabled.12 ) fire a Runtime error 91 and Item.Userproperties.count =0 , while there are some  custom fields.

    If i add the Userproperties with Item.ItemProperties.add "name",oltext   fire a runtime error 5 and if i click on Debug and i replay the same instruction no error fire and i find the custom Userproperties in the object item.

    What is the problem ?

    Claudio


    • Edited by MedCla Thursday, April 6, 2017 12:37 PM
    Thursday, April 6, 2017 10:41 AM

All replies

  • Try use UserProperties as collection:

    oItem = oMailItem.UserProperties.Add("Name", olText)


    Oskar Shon, Office System MVP - www.VBATools.pl
    if Helpful; Answer when a problem solved

    Friday, April 7, 2017 3:06 PM
    Answerer