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

Changing View to "Search Folder" Upon Start Up



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 24th 06, 08:03 AM posted to microsoft.public.outlook.program_vba
Luke242
external usenet poster
 
Posts: 3
Default Changing View to "Search Folder" Upon Start Up

Hey,
I want outlook to start up my Search Folder named "For Follow Up" showing up
as the default view.

I am truly a beginner and am trying to hack this together. The code below
will switch the view to "standard" folders underneath the Inbox, but not to a
Search Folder. Does any one have any ideas on how to change my view to a
Search Folder named "For Follow Up"?

Thanks for any help, Luke

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myolApp.ActiveExplorer.CurrentFolder = _
myFolder.Folders("For Follow Up")
Ads
  #2  
Old October 24th 06, 07:46 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Changing View to "Search Folder" Upon Start Up

The Search Folders hierarchy is hidden in the default mailbox's Folders
collection so you can't retrieve any by name AFAIK.

You can use the GetEntryIDForCurrentFolder macro below to retrieve the id
for your Search Folder and use that value in this SetSearchFolderAsCurrent
macro:

Sub SetSearchFolderAsCurrent()
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder

Set objNS = Application.Session
Set objFolder =
objNS.GetFolderFromID("0000000038F2773A1C598D49882 D14EC0C5C40C301003782A90F9FC7524AA3B8E8C77AB3BE960 00002D28F400000")

Set Application.ActiveExplorer.CurrentFolder = objFolder
Set objNS = Nothing
Set objFolder = Nothing
End Sub

Sub GetEntryIDForCurrentFolder()
Debug.Print Application.ActiveExplorer.CurrentFolder.EntryID
End Sub

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Luke242" wrote:

Hey,
I want outlook to start up my Search Folder named "For Follow Up" showing up
as the default view.

I am truly a beginner and am trying to hack this together. The code below
will switch the view to "standard" folders underneath the Inbox, but not to a
Search Folder. Does any one have any ideas on how to change my view to a
Search Folder named "For Follow Up"?

Thanks for any help, Luke

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myolApp.ActiveExplorer.CurrentFolder = _
myFolder.Folders("For Follow Up")

  #3  
Old October 25th 06, 03:10 AM posted to microsoft.public.outlook.program_vba
Luke242
external usenet poster
 
Posts: 3
Default Changing View to "Search Folder" Upon Start Up

Thanks. That works great. It took me a second to figure out how to use
debug.print and modify the code, but I learned something new. As I said, true
beginner... :-)

Luke

"Eric Legault [MVP - Outlook]" wrote:

The Search Folders hierarchy is hidden in the default mailbox's Folders
collection so you can't retrieve any by name AFAIK.

You can use the GetEntryIDForCurrentFolder macro below to retrieve the id
for your Search Folder and use that value in this SetSearchFolderAsCurrent
macro:

Sub SetSearchFolderAsCurrent()
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder

Set objNS = Application.Session
Set objFolder =
objNS.GetFolderFromID("0000000038F2773A1C598D49882 D14EC0C5C40C301003782A90F9FC7524AA3B8E8C77AB3BE960 00002D28F400000")

Set Application.ActiveExplorer.CurrentFolder = objFolder
Set objNS = Nothing
Set objFolder = Nothing
End Sub

Sub GetEntryIDForCurrentFolder()
Debug.Print Application.ActiveExplorer.CurrentFolder.EntryID
End Sub

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Luke242" wrote:

Hey,
I want outlook to start up my Search Folder named "For Follow Up" showing up
as the default view.

I am truly a beginner and am trying to hack this together. The code below
will switch the view to "standard" folders underneath the Inbox, but not to a
Search Folder. Does any one have any ideas on how to change my view to a
Search Folder named "For Follow Up"?

Thanks for any help, Luke

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myolApp.ActiveExplorer.CurrentFolder = _
myFolder.Folders("For Follow Up")

  #4  
Old October 25th 06, 07:14 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Changing View to "Search Folder" Upon Start Up

Am Mon, 23 Oct 2006 23:03:02 -0700 schrieb Luke242:

Why don“t you simply use the options dialog and chose the folder you want to
start with?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Hey,
I want outlook to start up my Search Folder named "For Follow Up" showing

up
as the default view.

I am truly a beginner and am trying to hack this together. The code below
will switch the view to "standard" folders underneath the Inbox, but not

to a
Search Folder. Does any one have any ideas on how to change my view to a
Search Folder named "For Follow Up"?

Thanks for any help, Luke

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myolApp.ActiveExplorer.CurrentFolder = _
myFolder.Folders("For Follow Up")

  #5  
Old October 25th 06, 07:48 AM posted to microsoft.public.outlook.program_vba
Luke242
external usenet poster
 
Posts: 3
Default Changing View to "Search Folder" Upon Start Up

Hhhmmm.... That takes all the fun out of it.

Seriously though, I searched the Outlook help file and Google for that
option and could not find it. After your suggestion, I was able to find it
and got my program all dialed in. Oh well...

Luke

"Michael Bauer [MVP - Outlook]" wrote:

Am Mon, 23 Oct 2006 23:03:02 -0700 schrieb Luke242:

Why donĀ“t you simply use the options dialog and chose the folder you want to
start with?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Hey,
I want outlook to start up my Search Folder named "For Follow Up" showing

up
as the default view.

I am truly a beginner and am trying to hack this together. The code below
will switch the view to "standard" folders underneath the Inbox, but not

to a
Search Folder. Does any one have any ideas on how to change my view to a
Search Folder named "For Follow Up"?

Thanks for any help, Luke

Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myFolder = _
myNamespace.GetDefaultFolder(olFolderInbox)
Set myolApp.ActiveExplorer.CurrentFolder = _
myFolder.Folders("For Follow Up")


 




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
Lost "Unread" Search Folder Beach Runner Outlook - General Queries 1 August 31st 06 03:39 AM
PST views - Can I hide "Search Folders" and "Deleted Items"? Rob Outlook - General Queries 1 August 25th 06 08:41 PM
Globally changing "File As" format for an Outlook Contact Folder DJS Outlook - Using Contacts 2 July 1st 06 12:32 AM
Can I start the "Weekly" view on a Sunday Tantrums Outlook - Calandaring 1 March 23rd 06 08:39 PM
In Table View can I group by "Date" instead of "Start" KLM Outlook - Calandaring 1 January 11th 06 05:52 AM


All times are GMT +1. The time now is 09:26 AM.


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.