View Single Post
  #4  
Old April 28th 09, 06:50 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom Form and firing Revise Contents button

Are you saying the MsgBox doesn't fire or something else?

In some cases things are only weak object references at the time the
Item_Open() event fires in form code.

In an addin I'd get those things in the first Inspector.Activate() event
handler, but that can't be done in form code. I also sometimes use a timer
to wait out the completion of an event, but again that can't be done in form
code.

I'd comment out the On Error line and see what line fires an error. In
addition, I'd also set up a CommandBars object and instantiate that as
objInsp.CommandBars, then if that was valid I'd call ExecuteMso() on that
object.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Christopher Slowik" wrote in
message ...
Ken, thanks for the information. I still cannot get this to fire. As a
test, I created a standard Post Item in a test folder. Placed the code
below
in the Item_Open event but it never seems to fire.

MsgBox "Here we are"
Dim objInsp
On Error Resume Next
Set objInsp = Item.GetInspector
objInsp.CommandBars.ExecuteMso("ReviseContents")
Set objInsp = Nothing

Thanks


Ads