Visual Basic Example

The following is an example referencing a PortalRegistry object using Visual Basic.

Dim oCref As ContentRef
Dim oCrefColl As ContentRefCollection

Set oSession = CreateObject("PeopleSoft.Session")
iResult = oSession.Connect(1, AppServStr, OperID, OperPasswd, 0)
Set oPortal = oSession.GetPortalRegistry
iResult = oPortal.Open("PORTAL")
Set oCrefColl = oPortal.RootFolder.ContentRefs
Set oCref = oCrefColl.InsertItem("papi012")
iResult = oPortal.Close
iResult = oPortal.Open("PORTAL")
Set oCref = oPortal.FindCRefByName("papi012")   
oPortal.Close
oSession.Disconnect
Exit Sub