Outlook-Exchange bug???

A

Alberto

Hello I'm just running this simple macro through a button to move to a
folder of a shared mailbox.

Sub Proc1()

Dim MyFolder As MAPIFolder
Set MyFolder = GetFolder("Postfach - SharedMailbox\FolderA") Sue's function
Set Outlook.Application.ActiveExplorer.CurrentFolder = MyFolder

End Sub

The macro works fine except in a case: when clicking on the button and until
that moment the user didn't had no interaction with the shared mailbox. If
this condition happens then the user goes to the folder but no preview pane
is available, it becomes grey. You can open the items but you have to restart
Outlook to view the folder properly. You don't see the preview pane and when
you click on properties of the folder you experience problems.

A "solution" for this problem is that the user must at least perform an
action with the involved shared mailbox (OR) others shared mailboxes in the
server like just clicking on a folder (no matter which one) and after that
the macro runs perfectly and you go to the folder and can see the preview
pane. I have tried to run programmatically an operation which involves the
mailbox like a GetItemFromID to try to "wake up" the sharedmailbox befor i
run the macro but still having the same problem.

So the question is how can i programmatically performs some kind of
operation so i can run the macro without problems anytime.


Using Outlook 2003,
Exchange also 2003 (6.5) but not sure at this moment.

Thanks again for the attention...
 
K

Ken Slovak - [MVP - Outlook]

Try accessing the Items collection of the folder:

Dim MyFolder As MAPIFolder
Set MyFolder = GetFolder("Postfach - SharedMailbox\FolderA")

Dim colItems As Outlook.Items
Dim obj As Object
Dim s As String

Set colItems = MyFolder.Items
Set obj = colItems(1)
s = obj.Subject

Set Application.ActiveExplorer.CurrentFolder = MyFolder
 
A

Alberto

Hi, I have tried to get the elements, but it doesn't work either.
I know where the problem is but I still think that's a bug:


The thing is that In the Application_MAPILogonComplete() procedure I made a
call to a procedure which uses Public Folders.


Private Sub Application_MAPILogonComplete()
Call Module1.GoodMorning()
End sub

It's just a silly module which takes an Item from a Public folder show its
subject through a MsgBox(). I modifiy the content of the subject and it it's
not empty the colleagues get a message everytime they start Outlook.


If between this call and the execution of the Macro which goes to a folder
of a Shared Mailbox there is no human interaction with the Folder Pane i.e.,
the macro will "fail" and the Sharedfolder will not be showed properly as
described earlier.

It has nothing to do with Application_MAPILogonComplete(), you could run
Module1.GoodMorning in a normal module with a button, what is important is
that between the 2 calls you don't "wake up" the shared mailbox.

I'm "sure" that is the right scenario. Anyway it's not a tragedy but it's
not fine.

Thanks
 
K

Ken Slovak - [MVP - Outlook]

I really have no idea what you're talking about with
Application_MAPILogonComplete() or what 2 calls you're talking about, that's
all information you never mentioned previously. It's hard to understand what
someone is talking about if they don't provide adequate information and they
add new information in every post.

Usually if a store hasn't been touched it's not fully opened. That applies
to a public folders store or a shared mailbox. Usually you access the Items
collection of a folder in that store to touch the store.
 
A

Alberto

Hi Ken,

Thanks for your answer. I see that my previous post was quite confussing and
difficult to understand but in every post that I wrote I always wrote what I
knew at that particular moment, now for example I have done some progresses.
I'll try to be clear an specific now because there's something wrong about
this and don't think is a small issue.

Say:

Sub GlobalTest()
Call proc1
Call proc2
End Sub


Sub proc1()

' Acces to a Public Folder

Dim ObjFolder As Outlook.MAPIFolder
Dim MyItems as Outlook.Items
Set ObjFolder = GetFolder("Öffentliche Ordner\FolderA\FolderB") ' Sue's
function
Set MyItems = ObjFolder.items
' Here some operations with the items (seems not to be relevant at all
which operations)

Set ObjFolder = Nothing
Set MyItems = Nothing

End Sub

Sub proc2()

'Sub to show a folder of a shared Mailbox

Dim ObjFolder As Outlook.MAPIFolder
Set ObjFolder = GetFolder("Postfach - ASharedMailbox\Folder1")
Set outlook.ActiveExplorer.CurrentFolder = ObjFolder
Set ObjFolder = Nothing

End Sub

Note: I have cutted the real procedures but the above code is the relevant
one.

So, after running GlobalTest() the preview pane of the explorer becomes
grey. I can open the items , that's true but i.e. I can not see properly the
permissions of the folder.. anyway, something is wrong.. To replicate this
scenario Folder1(or another of the shared mailbox) shouldn't have been
activated before by the user by clicking. In my first post I thought there
was something wrong with proc2() but later I realized that is the combination
of both procedures but i missed it because proc1() was executed automatically
when Outlook starts. I'm not really running GlobalTest() but let's say that
is the scenario.

Possible Solution 1 :
The user clicks on one of the folders of the shared mailbox after starting
Outlook and then Globaltest() runs perfectly. Ok, that's no problem, but I'm
not sure if later, after some hours without using the shared mailbox the user
will face the same problem when running GlobalTest() or proc1() and proc2()
separately after each other under the conditions described before...

Possible Soution 2:

The user "programmatically" clicks the shared mailbox before executing proc1()

Sub GlobalTest()
Cal proc2 ' Set the ActiveExplorer to a folder of the shared mailbox
(not necessarily \Folder1)
Call proc1
Call proc2
End Sub

Well it works... but I don't want to be forced to run proc2() before
running proc1(). Firstly I don't find it fair and secondly sometimes I'm only
interested on proc1() and if I run proc2() it means that I'll will have to
change the folder automatically to get the previos folder where the user was
working before calling proc1().

I really hope that the situation is more clear know and well, I don't find
any proper solution to this problem and I ask myself it this special
situation proc1() and proc2() executed under the circunstances described
before could be considered a bug of Outlook or Exchange... or just something
to live with...I don't hope so.

Using Outlook 2003 and Exchange 2003

---------------

Thanks for your help
 
K

Ken Slovak - [MVP - Outlook]

I'm sorry, I can't reproduce your problem here with Outlook 2003 and
Exchange 2003. I modified your code to first get the Items collection of a
public folder in my public folders store, then to display the Inbox folder
of my Support mailbox. The folder displayed correctly and the preview pane
displays just fine.
 
A

Alberto

Hi Ken, lot of thanks trying to clarify the problem. I have found now more
light. It seems nothing to do with VBA but with the initialization process of
Outlook.

CASE 1 ( The scenario where I made all the tests)

1) Internet connection available
2) Outlook starts
3) Run the macro Globaltest() * with the precaution of not
“touching†before any folder of the shared mailbox.
4) Folder(s) instantiated in proc2 appears with the grey preview pane
5) During the rest of the session having the problems with folder(s)
instantiated in proc2().

CASE 2

1) Internet connection NOT available
2) Outlook starts
3) Wait a little and reconnect again
4) Run the macro Globaltest() *
5) It works fine!

CASE 3 ( Variant of CASE 1)

1) Internet connection available
2) Outlook starts
3) Run the macro Globaltest() *
4) Folder(s) instantiated in proc2 appears with the grey preview pane
5) During the rest of the session having problems with folder(s)
instantiated in proc2().
6) Disconnect
7) Reconnect
8) Run the macro Globaltest() ..It doesn’t work but ..
9) Clicking on the folder(s) of the shared folder
10) Globaltest() works with the normal behauvior of the folders

Well, as long I know more I get confussed. Do you think it's possible to
make some settings from cliente side or server side to make it run properly
like it runs to you.

Sincerely, lot of thanks...
 
K

Ken Slovak - [MVP - Outlook]

I have no idea what settings would make the code work or not work as you
describe, so I have no idea how to fix what you're seeing. I can't repro it
here so I'm not sure what's happening on your end.
 
A

Alberto

Thank you Ken. I give up with the issue. I hope someday I will find why 2
operations just like:
--------
Dim MySharedFolder, MyPublicFolder

Set MyPublicfolder = ..... 'Folder in Exange Public Folder
Set MySharedFolder = ....'Folder in shared mailbox
------------

give me a problem when I run this code and go after that to the shared
folder without having "touched" it before.

Thanks for your advices.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top