Open current explorer in new window

  • Thread starter Thread starter Peter Marchert
  • Start date Start date
P

Peter Marchert

Hello,

I want to open the current explorer in a new window.

Set objExplorer =
objExplorers.Add(Outlook.Session.GetDefaultFolder(olFolderCalendar),
olFolderDisplayFolderOnly)
objExplorer.Display

The code above works fine, but if I try this code for the current
folder nothing happens :-(

Set objExplorer =
objExplorers.Add(Outlook.ActiveExplorer.CurrentFolder,
olFolderDisplayFolderOnly)
objExplorer.Display

What can I do?

Peter
 
Can you get CurrentFolder as a MAPIFolder object and then pass that object
to the Add method?
 
Hello Ken,

thanks for your answer.

I`m not sure if I understand you in the right way. I tried the
following with the same effect:

Sub OpenCurrentExplorer()

Dim objExplorer As Outlook.Explorer
Dim objExplorers As Outlook.Explorers
Dim objFolder As Outlook.MAPIFolder

Set objExplorers = Outlook.Explorers

Set objFolder = Outlook.ActiveExplorer.CurrentFolder
Set objExplorer = objExplorers.Add(objFolder,
olFolderDisplayFolderOnly)
objExplorer.Display

End Sub

Best regards
Peter

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- and Outlook-Programming
Can you get CurrentFolder as a MAPIFolder object and then pass that object
to the Add method?




Peter Marchert said:
Hello,

I want to open the current explorer in a new window.

Set objExplorer =
objExplorers.Add(Outlook.Session.GetDefaultFolder(olFolderCalendar),
olFolderDisplayFolderOnly)
objExplorer.Display

The code above works fine, but if I try this code for the current
folder nothing happens :-(

Set objExplorer =
objExplorers.Add(Outlook.ActiveExplorer.CurrentFolder,
olFolderDisplayFolderOnly)
objExplorer.Display

What can I do?

Peter

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- und Outlookprogrammierung
 
It looks like you have to set the Explorer first using a different folder
than in ActiveExplorer, then after the Explorer is created set its
CurrentFolder object to the folder you want. Then display the Explorer. For
example if the current folder is Inbox then:

Sub OpenCurrentExplorer()

Dim objExplorer As Outlook.Explorer
Dim objExplorers As Outlook.Explorers
Dim objFolder As Outlook.MAPIFolder
Dim objFolder2 As Outlook.MAPIFolder

Set objExplorers = Outlook.Explorers

Set objFolder = Outlook.ActiveExplorer.CurrentFolder

Set objFolder2 = Outlook.Session.GetDefaultFolder(olFolderCalendar)

Set objExplorer = objExplorers.Add(objFolder2,
olFolderDisplayFolderOnly)

Set objExplorer.CurrentFolder = objFolder

objExplorer.Display

End Sub
 
Aha, thanks a lot! Works fine!

Best regards
Peter

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- and Outlook-Programming

It looks like you have to set the Explorer first using a different folder
than in ActiveExplorer, then after the Explorer is created set its
CurrentFolder object to the folder you want. Then display the Explorer. For
example if the current folder is Inbox then:

Sub OpenCurrentExplorer()

Dim objExplorer As Outlook.Explorer
Dim objExplorers As Outlook.Explorers
Dim objFolder As Outlook.MAPIFolder
Dim objFolder2 As Outlook.MAPIFolder

Set objExplorers = Outlook.Explorers

Set objFolder = Outlook.ActiveExplorer.CurrentFolder

Set objFolder2 = Outlook.Session.GetDefaultFolder(olFolderCalendar)

Set objExplorer = objExplorers.Add(objFolder2,
olFolderDisplayFolderOnly)

Set objExplorer.CurrentFolder = objFolder

objExplorer.Display

End Sub




Peter Marchert said:
Hello Ken,

thanks for your answer.

I`m not sure if I understand you in the right way. I tried the
following with the same effect:

Sub OpenCurrentExplorer()

Dim objExplorer As Outlook.Explorer
Dim objExplorers As Outlook.Explorers
Dim objFolder As Outlook.MAPIFolder

Set objExplorers = Outlook.Explorers

Set objFolder = Outlook.ActiveExplorer.CurrentFolder
Set objExplorer = objExplorers.Add(objFolder,
olFolderDisplayFolderOnly)
objExplorer.Display

End Sub

Best regards
Peter

--
Peter Marchert
[EDV-Service Marchert]
Homepage: http://www.marchert.de
Excel- and Outlook-Programming
 
Back
Top