A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to automate showing the Public Folder Calender to Mail Favorite folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 28th 11, 11:50 AM
Sainyam Sainyam is offline
Junior Member
 
First recorded activity at Outlookbanter: Oct 2011
Posts: 1
Default How to automate showing the Public Folder Calender to Mail Favorite folder

How to automate the process to show my public folder calender in Mail Favorite folder?

I wanted to do it either by login script or by group policy.

I am using Microsoft Exchange server 2007 with Windows Server 2008 R2 and Domain controller running Windows Server 2003 R2.

All workstation system have either Outlook 2010 or Outlook 2007.

While searching on this I found the script below, but by this script (already modified the path) I am just able to make public folder calender to show in public folder favorite but not in mail favorite folder.







"Const olPublicFoldersAllPublicFolders = 18
Dim olkApp, olkSes, olkFolder
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNameSpace("MAPI")
'Change the profile name on the next line'
olkSes.Logon "Outlook"
'Change the folder name on the next line. Repeat the next two lines for each folder
you want to add.'
Set olkFolder =
olkSes.GetDefaultFolder(olPublicFoldersAllPublicFo lders).Folders("Public
calender").Folders("p cal")
olkFolder.AddToPFFavorites
'Change the folder name on the next line. Repeat the next two lines for each folder
you want to add.'
Set olkFolder = OpenOutlookFolder("Public Folders\Favorites\P cal")
AddFavoriteFolder olkFolder
olkSes.Logoff
Set olkApp = Nothing
Set olkSes = Nothing
Set olkFolder = Nothing
WScript.Quit

Sub AddFavoriteFolder(olkFolder)
' Purpose: Add a folder to Favorite Folders.'
' Written: 5/2/2009'
' Author: BlueDevilFan'
' Outlook: 2007'
Const olModuleMail = 0
Const olFavoriteFoldersGroup = 4
Dim olkPane, olkModule, olkGroup
Set olkPane = olkApp.ActiveExplorer.NavigationPane
Set olkModule = olkPane.Modules.GetNavigationModule(olModuleMail)
Set olkGroup =
olkModule.NavigationGroups.GetDefaultNavigationGro up(olFavoriteFoldersGroup)
olkGroup.NavigationFolders.Add olkFolder
Set olkPane = Nothing
Set olkModule = Nothing
Set olkGroup = Nothing
End Sub

Function OpenOutlookFolder(strFolderPath)
' Purpose: Opens an Outlook folder from a folder path.'
' Written: 4/24/2009'
' Author: BlueDevilFan'
' Outlook: All versions'
Dim arrFolders, varFolder, bolBeyondRoot
On Error Resume Next
If strFolderPath = "" Then
Set OpenOutlookFolder = Nothing
Else
Do While Left(strFolderPath, 1) = "\"
strFolderPath = Right(strFolderPath, Len(strFolderPath) - 1)
Loop
arrFolders = Split(strFolderPath, "\")
For Each varFolder In arrFolders
Select Case bolBeyondRoot
Case False
Set OpenOutlookFolder = olkSes.Folders(varFolder)
bolBeyondRoot = True
Case True
Set OpenOutlookFolder = OpenOutlookFolder.Folders(varFolder)
End Select
If Err.Number 0 Then
Set OpenOutlookFolder = Nothing
Exit For
End If
Next
End If
On Error GoTo 0
End Function "
Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Public folder favorite disappears J. Huber Outlook - General Queries 6 March 2nd 08 10:34 PM
public folder favorite, private contact BorisS Outlook - Using Contacts 1 November 29th 07 02:35 PM
Automate public folder additions?? Rottie_Grrrl Outlook - Using Contacts 1 August 16th 07 03:11 PM
Automate Public Folder Creation John Mc Cabe Outlook and VBA 1 August 16th 06 05:01 PM


All times are GMT +1. The time now is 04:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.