Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User form and Command button Marilyn Excel Discussion (Misc queries) 3 May 9th 07 12:50 AM
Open an Outlook folder when a user clicks on a command button ... Rob Keel Excel Discussion (Misc queries) 2 August 1st 05 08:23 AM
Opening an Outlook public folder from Excel using a command button... Rob Keel[_2_] Excel Programming 1 July 29th 05 06:02 PM
Why 2 clicks on a command button cush Excel Programming 2 May 10th 05 07:16 PM
How to create a URL and when user clicks it to open a Excel workbook Belinda Excel Programming 2 May 30th 04 01:06 PM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"