programmatically add a My Link.

This is how you add a My Link (aka QuickLink) in code.

Add a Reference to Microsoft.Office.Server

Import/using
Microsoft.Office.Server
Microsoft.Office.Server.UserProfiles 

Dim context As ServerContext = ServerContext.Current
Dim profilmanager As UserProfileManager = New UserProfileManager(context)
Dim profile As UserProfile = profilmanager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName)
Dim qlmanager As QuickLinkManager = New QuickLinkManager(profile)
Dim ql As QuickLink = qlmanager.Create(pTitle, pUrl, pQuickLinkGroupType, pGroup, pPrivacy)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: