Outlook crashes with File>open>other users folder????

K

Kristy

Hi

I am using Office 2000, Outlook 2000, VB6 & Outlook Redemption.

I have created an Outlook Com-addin. Everything is running well except
when users (on an exchange 2000 server) click on File>Open>Other Users
Folder. It looks like it is about to work but instead it hangs for a
few seconds and then crashes (No error message, Outlook completely
shuts down).

If I try to debug my add-in, ie project open and 'stop' placed in
OnConnection_ event (since I have no idea where this might be
happening, this is the best I can do!), it actually works fine with no
errors and opens other users inbox, calender... whatever with no
errors.... compile the same code and bang, failure?????

I have ensured that all users have the correct "delegates" access.

Any ideas on how I should proceed to find out what is causing this
error so I can fix it? Situation CRITICAL!

Thanks

Kris
 
T

Tom Winter

Kristy said:
Hi

I am using Office 2000, Outlook 2000, VB6 & Outlook Redemption.

I have created an Outlook Com-addin. Everything is running well except
when users (on an exchange 2000 server) click on File>Open>Other Users
Folder. It looks like it is about to work but instead it hangs for a
few seconds and then crashes (No error message, Outlook completely
shuts down).

If I try to debug my add-in, ie project open and 'stop' placed in
OnConnection_ event (since I have no idea where this might be
happening, this is the best I can do!), it actually works fine with no
errors and opens other users inbox, calender... whatever with no
errors.... compile the same code and bang, failure?????

I have ensured that all users have the correct "delegates" access.

Any ideas on how I should proceed to find out what is causing this
error so I can fix it? Situation CRITICAL!

Thanks

Kris

Way back when, I was developing an add-in for Outlook 2000 that would be
used in an Exchange Server environment. I encountered much the same
behavior, with Outlook crashing when people would switch to another user's
folder. (I imagine it only happened when compiled as well, not in the IDE.
Don't remember, but I encountered that type of thing a lot with Outlook and
Office.) I narrowed the crash down to when I called
Explorer.CommandBars.FindControl(s). I had to switch to
Explorer.CommandBars.ActiveMenuBar.FindControl. (There is no FindControls
method for a CommandBar object (as opposed to CommandBars) in Outlook 2000.)
I did NOT find this type of problem with Inspectors.

Don't know if you are doing that type of thing, but at least you know you
are not alone with Outlook weirdness. You may just have to put tons of
Msgbox's throughout your code to narrow down exactly where the crash is.
That's what I do.
 
K

Ken Slovak - [MVP - Outlook]

Try showing your code. If it is too large then place strategic MsgBox
statements in your code at various places like where you are iterating
folders and so on to see where the MsgBoxes stop showing up. An
alternate approach is to write messages into a text file at different
points in your program to see where it is hanging.
 
K

Kristy

Hi John

Yes there is. My project is based on the example provided from
Microeye. The activate event is...

Private WithEvents m_objExpl As Outlook.Explorer

Private Sub m_objExpl_activate()
Call RefreshToolbar(m_objExpl.CurrentFolder)
End Sub

The RefreshToolbar sub routine finds my toolbar and refreshes each of
the buttons, some are displayed some aren't depending on what folder
you are in etc. (cut down code)

Private Sub RefreshToolbar(objFolder As Outlook.MAPIFolder)
On Error Resume Next
Dim cbFMM As Office.CommandBar
Dim cbbCustomButton As Office.CommandBarButton
Dim i As Integer

Set cbFMM = m_objExpl.CommandBars("My Toolbar")
Set cbbCustomButton = cbFMM.FindControl(Tag:="My Button")

If objFolder Is Nothing Then 'Handle file system folder
Exit Sub
Else
Select Case objFolder.DefaultItemType
Case olMailItem....

I worked through the code and there seems to be a problem within the
RefreshToolbar sub. It crashes at...

Set cbbFMM = m_objExpl.CommandBars("My Toolbar")

If I change that line to specify the ActiveExplorer (similar to what
Tom suggested - Thanks Tom)...

Set cbbFMM = Outlook.ActiveExplorer.CommandBars("My Toolbar")

Then it seems to be fine, well it doesn't crash however it still
doesn't accept that I am in a folder (albeit someone elses) and
returns true to objFolder Is Nothing.

I am saying 'seems' as I haven't tested on the customer site yet, only
on my 2000 test pc. Also I haven't checked the Inspector_activate
event yet. I would really appreciate if you have any information on
this, so that I can check the rest of my code. This project has been
a steep learning curve for me, I feel like I've run into problems at
every turn but I really want to be a good programmer so any
information that you have would be greatly appreciated... and
absorbed!

Thanks

Kristy
 
J

John Covert

Sorry I let this drop, Kristy.

I use a lot of Activate Event code as well and it is nearly impossible to
debug within the VB IDE. I concur with Mr. Slovak's suggestion - use an
alternate method to debug, especially if you theorize that the defect may be
within an Activate Event. I typically use the Clipboard to do so.

At the top of the event, use:

Clipboard.Clear
Clipboard.SetText "STARTING THIS EVENT", vbCFText

then at periodic places in the code use:

Clipboard.SetText Clipboard.GetText & vbCrLf & vbCrLf & "I am about to
Add a toolbar button", vbCFText
 

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