Jonas Huber
asked on
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&anchorAnswerId=42428718#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.GetDefa ultFolder( olPublicFo ldersAllPu blicFolder s).Folders .Item("GR\ <subcontac tfolder>")
i tried this one but it didnt work so i think its the wrong syntax.
Regards
so i had this Problem:
https://www.experts-exchange.com/questions/29077332/Converting-VBA-in-VBS.html?anchor=a42428718¬ificationFollowed=202388954&anchorAnswerId=42428718#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.GetDefa
i tried this one but it didnt work so i think its the wrong syntax.
Regards
ASKER
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
my code looks like this now and i get an error in line 8 , that the object does not support the property
So, is BGN a true folder, or perhaps a Contacts object?
»bp
»bp
ASKER
BGN is a Contactfolder which needs to be displayed like an address book.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now i get an error in line 9 , that the argument (ShowAsOutlookAB) is not optional.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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.
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
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
ASKER
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:
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.
objItemBGN.ShowAsOutlookAB = True
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.
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
»bp
ASKER
Ok nevermind but thanks for your help.
Open in new window
»bp