How to use .ShowAsOutlookAB

Hi,

so i had this Problem:
https://www.experts-exchange.com/questions/29077332/Converting-VBA-in-VBS.html?anchor=a42428718¬ificationFollowed=202388954#a42428718
It got solved, but now i need to show all contactfolders within this "GR" main folder as address books.
I found this property (.ShowAsOutlookAB) but i need to get into the subfolders to use it, so i need the syntax to get to it like:

set objFolder = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GR\<subcontactfolder>")

i tried this one but it didnt work so i think its the wrong syntax.

Regards
Jonas HuberAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Each node needs to be a ne ITEM, so try:

set objFolder = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GR").Item("<subcontactfolder>")

Open in new window


»bp
0
Jonas HuberAuthor Commented:
 const olPublicFoldersAllPublicFolders=18
Dim objOutlook
Dim objFolder
Dim objItemBGN
 set objOutlook = CreateObject("Outlook.Application")
 set objFolder = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GR") 
 objFolder.AddToPFFavorites
set objItemBGN = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GR").Item("BGN")
 objItemBGN.ShowAsOutlookAB

Open in new window


my code looks like this now and i get an error in line 8 , that the object does not support the property
0
Bill PrewCommented:
So, is BGN a true folder, or perhaps a Contacts object?


»bp
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jonas HuberAuthor Commented:
BGN is a Contactfolder which needs to be displayed like an address book.
0
Bill PrewCommented:
Sorry, was forgetting the object model just a bit there.  I think this should work:

Const olPublicFoldersAllPublicFolders=18
Dim objOutlook
Dim objFolder
Dim objItemBGN
Set objOutlook = CreateObject("Outlook.Application")
Set objFolder = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("GR") 
objFolder.AddToPFFavorites
Set objItemBGN = objOutlook.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("GR").Folders("BGN")
objItemBGN.ShowAsOutlookAB

Open in new window


»bp
0
Jonas HuberAuthor Commented:
Now i get an error in line 9 , that the argument (ShowAsOutlookAB) is not optional.
0
Bill PrewCommented:
Try:

objItemBGN.ShowAsOutlookAB = True


»bp
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jonas HuberAuthor Commented:
Ok that worked thanks so far.
Just one question, nothing important, but its marked as "show as address book" in the publicfolder section.
Is it possible to get it marked in the favorite section?
What do i have to change ?
I mean it's the same result, but just for me to understand.
0
Bill PrewCommented:
Are you trying to add it to the Public Folder Favorites?

Or the Outlook Mail Favorites?

Or is it already in the PF Favs, and you want to change how it looks in the Favs section?

Sorry, not sure what you are asking...


»bp
0
Jonas HuberAuthor Commented:
With the code i posted earlier i add it to the PF fav. and in this section you can tick them for showing up as address book like we did with:

objItemBGN.ShowAsOutlookAB = True

Open in new window


But we did it in the PF section and i'd like to do that in the PF fav. section. In both scenarios i'd would show up the same way, but on removal it would react in diffrent ways. But as i said nothing important.
0
Bill PrewCommented:
Searched around a bit, and I didn't stumble on to a way to access the items in the PF Favs "folder", not sure if it's possible in VBA or not, but couldn't find it quickly.


»bp
0
Jonas HuberAuthor Commented:
Ok nevermind but thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.