Userproperties.add (complains about being read only)???

C

castle8000

Hello.

Can somebody tell me why the following code does not work?

----
For Each l_item In Dokumente_ordner.Items
l_item.Userproperties.Add "myAnsprechpartner", olText
l_item.UserProperties.Find("myAnsprechpartner").Value = "test"
Next
----

It complains that "Tis property is read only." in line 2 (where i want to
add a Userproperty)

THX!!!

best regards,

Fabian Werner
anyWARE AG,
Germany
 
S

Sledge Hammer via OfficeKB.com

Same problem here:

attachItem.UserProperties.Add("ItemID", olText, True, olText) = itemID
^^ after this statement Err.Description == "The operation failed."

Tried referencing:
Set a = attachItem.UserProperties.Add("ItemID", olText, True, olText)
a.Value = itemID
Pops out with "This property is read-only"..

? TypeName(attachItem)
DocumentItem
' Born like this:
Set attachItem = folderAdmin.items.Add("IPM.Document")
? TypeName(folderAdmin)
MAPIFolder

? TypeName(itemID)
String

What-to-do?..

Thanks in advance!
 
S

Sue Mosher [MVP-Outlook]

It is not possible to add custom properties to an Outlook DocumentItem.
 
S

Sue Mosher [MVP-Outlook]

The newsgroup interface you are using apparently does not quote earlier
messages in the thread, making your latest message so short on detail that
you risk not getting the answer you're looking for. Please take the time to
quote the original message.
 
S

Sledge Hammer via OfficeKB.com

It is not possible to add custom properties to an Outlook DocumentItem.

Neither via CDO?

The newsgroup interface you are using apparently does not quote earlier
messages in the thread, making your latest message so short on detail that
you risk not getting the answer you're looking for. Please take the time to
 
S

Sue Mosher [MVP-Outlook]

I've never tried it, but I don't think it will work. The DocumentItem simply doesn't support custom Outlook properties. Word and Excel documents, of course, do support custom properties added through their own interfaces.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top