+ Post New Thread
Results 1 to 15 of 15
Office Software Thread, Outlook 2013 - Automate Add to Favourites in Technical; Hi, Does anyone know of any script I can use that will add a public calendar to favourites. Like you ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444

    Outlook 2013 - Automate Add to Favourites

    Hi,

    Does anyone know of any script I can use that will add a public calendar to favourites. Like you would do manually in the attached.

    Thanks
    Attached Images Attached Images

  2. #2

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    Thanks, its good but i was wondering if anyone has anything for our exact needs please?

  3. #3

    Join Date
    Aug 2007
    Posts
    811
    Thank Post
    98
    Thanked 64 Times in 46 Posts
    Rep Power
    25
    I have one that should do mate.

    Will post when I get back. It waits for outlook to be launched and then adds public folder favourites to the public folder favourites and then add these to the main favourites. You could get it to do just the last but. Its vbs.

    Tim

  4. #4

    Join Date
    Aug 2007
    Posts
    811
    Thank Post
    98
    Thanked 64 Times in 46 Posts
    Rep Power
    25
    Sorry that should read "adds the calender" to the public folder favourites. Then adds it to the main "Mail favourites"

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    That would be great. Thanks

  6. #6

    Join Date
    Aug 2007
    Posts
    811
    Thank Post
    98
    Thanked 64 Times in 46 Posts
    Rep Power
    25
    Sorry for delay..

    We have four public folders that staff wanted not only in their public folder favourites but also in the main top favourites.

    In this script they are:
    Head's Notices
    Weekly Tutor Focus
    Daily Bulletin
    Rewards & Sanctions

    But im sure you could change it to your calender and strip the others out.
    This script is for 2010 and 2013 as it needs the users email address in the public folder address.

    This first script waits for outlook to open before calling the script that add the favourites.
    I left the first script link enabled for a few weeks until everyone had the favourites stored and then link disabled it.

    Outlook_Watcher_Script.vbs

    Code:
    Set objShell = CreateObject("Wscript.Shell")
    
    strComputer = "."
    
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    
    Set colMonitoredProcesses = objWMIService. _        
        ExecNotificationQuery("Select * from __InstanceCreationEvent " _ 
            & " Within 1 Where TargetInstance ISA 'Win32_Process' AND " & _
                "TargetInstance.Name = 'Outlook.exe'")
    
    Do While True
        Set objProcess = colMonitoredProcesses.NextEvent
        objShell.Run "\\server\netlogon\scripts\Set_PublicFolders_2010.vbs" 
    Loop


    2010/2013 - Set_PublicFolders_2010.vbs

    Code:
    'Function to get email address"
    Function GetAddress()
    
    On Error Resume Next
        Dim objSysInfo, objUser
        Set objSysInfo = CreateObject("ADSystemInfo")
        Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
        GetAddress = objUser.EmailAddress 
    End Function
    
    wscript.sleep(4000) '4 second
    
    Const olPublicFoldersAllPublicFolders = 18
    Const olFavoriteFoldersGroup = 4
    
    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"
    
       On Error Resume Next
    '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 - " & GetAddress() & "\All Public Folders\Head's Notices")
    olkFolder.AddToPFFavorites
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\All Public Folders\Weekly Tutor Focus")
    olkFolder.AddToPFFavorites
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\All Public Folders\Daily Bulletin")
    olkFolder.AddToPFFavorites
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\All Public Folders\Rewards & Sanctions")
    olkFolder.AddToPFFavorites
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\All Public Folders\Urgent Staff Notices")
    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 - " & GetAddress() & "\Favorites\Head's Notices")
    AddFavoriteFolder olkFolder
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\Favorites\Weekly Tutor Focus")
    AddFavoriteFolder olkFolder
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\Favorites\Daily Bulletin")
    AddFavoriteFolder olkFolder
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\Favorites\Rewards & Sanctions")
    AddFavoriteFolder olkFolder
    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\Favorites\Urgent Staff Notices")
    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.GetDefaultNavigationGroup(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

  7. Thanks to burgemaster from:

    FN-GM (4th June 2013)

  8. #7

    Join Date
    Jul 2013
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile

    Burge,


    I was looking at the script and I think what FN-GM wants is not to add it to the folder mail favorites but to the calendar favorites. right now what happens is it adds it to the favorites but it doesn't display the content until someone goes out and actually clicks on the calendar to display. I have been looking to do that as well. I did get the code to work as far as bringing in the calendars but then to display them it doesn't work out. Another note also I have only gotten it to work with Outlook 2010. The code won't work with 2013. Is there a difference.


    Thanks,

  9. #8

    Join Date
    Aug 2007
    Posts
    811
    Thank Post
    98
    Thanked 64 Times in 46 Posts
    Rep Power
    25
    Hi,

    Will have a look when I get some time. It is working here on 2013 outlook. We skipped 2010.
    Good luck!

  10. #9

    Join Date
    Jul 2013
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This is similar to what i am trying to accomplish. I can get it to show in the public folder favorites and therefore in the "others" category under calendars but i would like to see if I can have it selected as well. It works great in Outlook 2010 but can't seem to get it working in Outlook 2013. Is there anything different between the two. I know others have said it works in either. I just can't see to get it working. Add public Calendar to Calendar list - W&J ITS HelpDesk - Washington & Jefferson College Confluence

  11. #10

    Join Date
    Jul 2013
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I think I figured it out. It seems to only work with 32Bit. It is not working on 64bit version. Also if these changes are made do they carry over to any other outlook client I might open or via web outlook. I am testing but it doesn't seem to be there. Just wondering if this is possible. That the changes are stored on exchange and can carry over.



    thanks

  12. #11

    Join Date
    Jul 2013
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    It seems that it works fine with Outlook 2013 32Bit version and not 64Bit version at this point, but we ran into another snafu. I guess the bigger question needs to be answered.

    Overall scenario: share with all employees a calendar of events for the entire school. Currently we push the calendar or I should say events via script but this puts every school event on everyone's personal calendar. Since this is done only once a year we miss everyone that gets hired mid-year. Also If there is a mistake we then have to resend stuff out. We would prefer to still push a calendar out but in the manner mentioned earlier in the topic. Can this be possible but at the same time allow the end user to see it via outlook or web outlook. They can always delete it if they do not choose to use it but at least from our stand point we send it out.

    Any ideas

  13. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    @tacotech not got time to read now just off out. But thanks for posting, will read soon

  14. #13

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    @burgemaster it seems to work well for any items in a folder but i can't get it to work where there is a calendar in a folder. Any ideas please? Maybe there is a way to target the actual calendar?

    Thanks

  15. #14

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    Think i have done it change the path to something like

    Set olkFolder = OpenOutlookFolder("\Public Folders - " & GetAddress() & "\All Public Folders\Head's Notices\Calendar Name")

  16. #15

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,816
    Thank Post
    873
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444
    Hmm having issue with the watcher script. Its telling me the path to the Set_PublicFolders_2010.vbs is invalid. It isnt though.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 1
    Last Post: 22nd November 2012, 08:13 PM
  2. [MS Office - 2007] add to dictionary permissions
    By RabbieBurns in forum Office Software
    Replies: 2
    Last Post: 28th August 2008, 04:03 PM
  3. Outlook Express - Allow send to one email
    By googlemad in forum Windows
    Replies: 1
    Last Post: 27th February 2008, 12:54 PM
  4. Anon Proxt Site - Add to your list
    By ICTNUT in forum Windows
    Replies: 0
    Last Post: 20th April 2007, 01:17 PM
  5. Outlook 2007 sending emails to @local
    By Mintsoft in forum Windows
    Replies: 0
    Last Post: 7th July 2006, 11:52 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •