OL 2000 Add-In programming problem

S

Sarah Schreiber

I am working with my first Outlook programming application
using VB 6.0 SP4, Outlook 2000 SP 1, Exchange 2000 SP 3.
I am using an Add-in with a reference to Office 9.0 To
get started, I used the demo ItemCB and the book Microsoft
Outlook Programming. I have 2 problems.

1. When I first started running the ItemsCB demo w/
my modifications, it ran fine and could see it running in
or out of debug mode. After several openings and closings
of Outlook, I would have to restart my computer and then
the changes were back. Now I am down to having to restart
every time and then I only have one shot to see a change.
I have been looking at the Newgroup posting, but haven't
seen anything like this. I see some references to CDO
1.21. Could I be using that improperly?

2. Next, how do I reference a mailitem that is open
in the inbox? I want to sent the entire .msg file to SQL
to be passed to another application. I think I need to
pass it as a Scripting FileSystemObject object so I need
to get the file.
 
K

Ken Slovak - [MVP - Outlook]

An open item is in an Inspector. The current open item is ActiveInspector.
Inspector.CurrentItem is the mail item you want to work with.

Are you sure Outlook is really closing? Check it in the Task Manager's
Processes tab. Your symptoms seem to indicate it's not really shutting down.
Do you get an On_Diconnection event after you release all your Outlook
objects?

I'm not really sure what you mean by "the changes were back", can you please
explain?
 
S

Sarah Schreiber

Thanks for responding.

I have made more progress on my first problem and I now
know it is related to running in debug mode, getting an
error in VB code and only having the option to end or
debug. I ran it on another machine and although they got
the errors, they were not in debug mode and I got the
expected behavior. For now, looks like I should put some
code in to shut Outlook down from the error handler or add
Resume Next. I don't think Outlook was really closing as
you suspected.

I also appreciate the syntax for the mailitem file.
 
K

Ken Slovak - [MVP - Outlook]

Outlook COM addins *must* handle all errors or Outlook will not close or the
addin will crash and crash Outlook. At minimum that means having an On Error
Resume Next statement in every procedure. Even in debug mode if you have
that you can get the error that was generated. I usually use Watch windows
for that and either set the watch to break on Err or just to display the Err
object.
 

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