Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programmatically get properties name

  Asked By: Justin    Date: Feb 07    Category: Sharepoint    Views: 1527

I've a piece of code that gets the profiles of a specific folder. How can I
get the properties of that profile?

Dim oFolder As New PKMCDO.KnowledgeFolder
Dim strProfile As String

oFolder.DataSource.Open "MyFolder"
'(..get properties names/List values/ect...)



1 Answer Found

Answer #1    Answered By: Indu Raj     Answered On: Feb 07

You can use the following code  for getting the
properties of profile

Set lobjKnWk = New PKMCDO.KnowledgeWorkspace
Set lobjKnCC = New PKMCDO.KnowledgeContentClass
Set lobjKnPropDef = New PKMCDO.KnowledgePropertyDef
Set ldictKnProperty = New Scripting.Dictionary
'bind to the workspace
lobjKnWk.DataSource.Open Trim(gsWorkspaceName), , , ,
, Trim(gsCoordID), Trim(gsCoordPassword)

'form the total urn path for the profile
'lsProfilePath = "urn:content-classes:" +
lsProfilePath = Trim(sProfileName)
'retrieve all the properties  associated with a
document profile
Set lobjKnCC = lobjKnWk.GetObject(lsProfilePath)

'for each property identify whether it is mandatory
and/or multivalued
lsListBox = 0
For Each lKnObj In
msgbox lobjKnPropDef.Name

and for getting the list values you can use this code
'bind to the workspace
lobjKnWk.DataSource.Open gsWorkspaceName, , , , ,
Trim(gsCoordID), Trim(gsCoordPassword)

'retrieve all the properties associated with a
document profile
Set lobjKnPropDef = lobjKnWk.GetObject(sPropName)
lsPropUrn = lobjKnPropDef.Dictionary
larrValues =
For licntr = 0 To UBound(larrValues)
msgbox CStr(larrValues(licntr))

Didn't find what you were looking for? Find more on Programmatically get properties name Or get search suggestion and latest updates.