Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Add folder shortcut to Favs
Ben_inform
How can i adda folder shortcut to my favourites in VB ?
I have followed the com ref manual and got this but i get a type mismatch on Set oShortcuts = oFavorites.Contents
Dim oWorkArea As IManWorkArea
Dim oFavorites As IManFavoritesFolder
Dim objFolderShortCut As IManFolderShortcut
Dim objFolder As IManFolder
Dim oShortcuts As IManFolderShortcuts
Set oWorkArea = isess.WorkArea
Set oFavorites = oWorkArea.FavoritesFolder
Set objFolder = ofolder
Set oShortcuts = oFavorites.Contents
Set objFolderShortCut = oShortcuts.AddNewFolderShortcut(ofolder)
Find more posts tagged with
Comments
DaleN
Hi Ben,
The problem is that you are accessing the Contents property of the Favorites instead of the SubFolders. Contents refers to collections of objects like documents, events, tasks and messages. You want to add a shortcut to a container so you need to work with an object that handles that (i.e. folders) - casting the oShortcuts as a IManContents type won't work. Try changing your code to the following
Dim oWorkArea As IManWorkArea
Dim oFavorites As IManFavoritesFolder
Dim objFolderShortCut As IManFolderShortcut
Dim objFolder As IManFolder
Dim oShortcuts As IManFolderShortcuts
Set oWorkArea = isess.WorkArea
Set oFavorites = oWorkArea.FavoritesFolder
Set objFolder = ofolder
Set oShortcuts = oFavorites.SubFolders
Set objFolderShortCut = oShortcuts.AddNewFolderShortcut(ofolder)
Regards,
Dale