+ Reply to Thread
Results 1 to 3 of 3

Open an Outlook folder when a user clicks on a command button ...

  1. #1
    Rob Keel
    Guest

    Open an Outlook folder when a user clicks on a command button ...

    Looking for a way to open a specific Outlook folder when a user clicks on a
    command button in Excel. If Outlook is not currently running, I also need
    the code to launch Outlook and then go to the specified folder. Is this
    possible?

    Anyone any ideas please?

    Many thanks for your time.

    Rob.



  2. #2
    Steve Yandl
    Guest

    Re: Open an Outlook folder when a user clicks on a command button ...

    Here is a sample that would open the Contacts folder. After opening the VBE
    editor, you would set a reference to Microsoft Outlook nn Object Library (in
    my case, nn is 11.0). Then the following routine would display the Contacts
    folder.

    Sub ShowContacts()
    Dim olApp As Outlook.Application
    Dim olNS As Outlook.Namespace
    Dim fdContacts As Outlook.MAPIFolder
    Set olApp = New Outlook.Application
    Set olNS = olApp.GetNamespace("MAPI")
    Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
    fdContacts.Display
    End Sub


    Steve



    "Rob Keel" <robkeel@[removethis]gmail.com> wrote in message
    news:[email protected]...
    > Looking for a way to open a specific Outlook folder when a user clicks on
    > a
    > command button in Excel. If Outlook is not currently running, I also need
    > the code to launch Outlook and then go to the specified folder. Is this
    > possible?
    >
    > Anyone any ideas please?
    >
    > Many thanks for your time.
    >
    > Rob.
    >
    >




  3. #3
    Rob Keel
    Guest

    Re: Open an Outlook folder when a user clicks on a command button ...

    Thanks for that Steve. Got that working fine however, how would I
    reference a Public Folder? i.e. path is (in Outlook Folder list) Public
    Folders\All Public Folders\MyFolder

    How would I refer to and open MyFolder?

    Thanks.

    Rob.


    Steve Yandl wrote:
    > Here is a sample that would open the Contacts folder. After opening the VBE
    > editor, you would set a reference to Microsoft Outlook nn Object Library (in
    > my case, nn is 11.0). Then the following routine would display the Contacts
    > folder.
    >
    > Sub ShowContacts()
    > Dim olApp As Outlook.Application
    > Dim olNS As Outlook.Namespace
    > Dim fdContacts As Outlook.MAPIFolder
    > Set olApp = New Outlook.Application
    > Set olNS = olApp.GetNamespace("MAPI")
    > Set fdContacts = olNS.GetDefaultFolder(olFolderContacts)
    > fdContacts.Display
    > End Sub
    >
    >
    > Steve
    >
    >
    >
    > "Rob Keel" <robkeel@[removethis]gmail.com> wrote in message
    > news:[email protected]...
    > > Looking for a way to open a specific Outlook folder when a user clicks on
    > > a
    > > command button in Excel. If Outlook is not currently running, I also need
    > > the code to launch Outlook and then go to the specified folder. Is this
    > > possible?
    > >
    > > Anyone any ideas please?
    > >
    > > Many thanks for your time.
    > >
    > > Rob.
    > >
    > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1