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

Error 287 on Inspector.Close()



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old November 19th 09, 06:30 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Error 287 on Inspector.Close()

olInspector is one of the OlObjectClass enums, you cannot have a varable
with that name.
Secondly, change the code to the following (notice Inspectors.Item)

Set Inspector = Application.Inspectors.Item(1)
Inspector.Close(olDiscard)

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Synced" wrote in message
...
I can't even do the following for example:

Dim olInspector as Inspector
Set olInspector = Application.Inspectors(1)
olInspector.Close(olDiscard)

I get the 287 error. I also get the 287 error if I try to close a MailItem
in the CommandBarButton Click event.

Any ideas what I am doing wrong? Is error 287 always related to security?
Like I said in the other post. I thought code security was supposed to
prompt
when security is becoming an issue.

I'm not getting any prompts, just error 287 exceptions.

Thanks again in advance for all the help.

"Dmitry Streblechenko" wrote:

What is teh relevant snippet off your code?
When exactly is your code executed (a particular event handler etc)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Synced" wrote in message
...
Hey gang.

Fairly new to automating office/outlook. I am working on a COM add-in
written in VB6.

I am getting an error 287 when trying to do a Close() call on an
Inspector
or MailItem.

I did a bunch of read up and this seems to be related to the security
features in office however my Application object does say it is trusted
so
why am I hitting this issue?

So how do I work around this? Am I doing something wrong?

Any help would be greatly appreciated.

Thanks!



.



 




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
Compiler warning CS0467 for Inspector.Close Lucy Outlook - Using Forms 2 September 2nd 08 12:05 AM
Inspector wrapper and Inspector close not fireing [email protected] Add-ins for Outlook 1 June 20th 08 01:53 PM
Inspector Close events not firing.. Sanjay Add-ins for Outlook 1 May 22nd 06 06:18 PM
Help! Inspector.Close is fired before Inspector.Activate handler finishes Sergey Anchipolevsky Add-ins for Outlook 8 February 9th 06 09:51 AM
Outlook 2003 fires an Inspector Close when a send is cancelled Steve D Add-ins for Outlook 8 February 8th 06 11:22 PM


All times are GMT +1. The time now is 03:43 PM.


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.